#[cfg(all(feature = "rust_crypto", feature = "aws_lc_rs"))]
#[test]
fn tie_break_selects_aws_lc_rs() {
let selected = super::preferred_provider();
assert!(
std::ptr::eq(selected, &jsonwebtoken::crypto::aws_lc::DEFAULT_PROVIDER),
"the tie-break must select the aws_lc_rs provider"
);
assert!(
!std::ptr::eq(
selected,
&jsonwebtoken::crypto::rust_crypto::DEFAULT_PROVIDER
),
"the tie-break must not fall back to RustCrypto"
);
}
#[cfg(all(feature = "aws_lc_rs", not(feature = "rust_crypto")))]
#[test]
fn aws_lc_rs_only_build_installs_aws_lc_rs() {
assert!(std::ptr::eq(
super::preferred_provider(),
&jsonwebtoken::crypto::aws_lc::DEFAULT_PROVIDER
));
}
#[cfg(all(feature = "rust_crypto", not(feature = "aws_lc_rs")))]
#[test]
fn rust_crypto_only_build_installs_rust_crypto() {
assert!(std::ptr::eq(
super::preferred_provider(),
&jsonwebtoken::crypto::rust_crypto::DEFAULT_PROVIDER
));
}
#[test]
fn installing_twice_is_harmless() {
super::install_default_crypto_provider();
super::install_default_crypto_provider();
}