Fix MSRV build and tests

This commit is contained in:
Steven Roose 2024-02-09 18:30:16 +00:00
parent 7f554391ae
commit 5dcdac9c74
No known key found for this signature in database
GPG Key ID: 2F2A88D7F8D68E87
3 changed files with 21 additions and 6 deletions

View File

@ -2,14 +2,15 @@
set -ex
FEATURES="serde rand zeroize all-languages chinese-simplified chinese-traditional czech french italian japanese korean portuguese spanish"
FEATURES="serde rand all-languages chinese-simplified chinese-traditional czech french italian japanese korean portuguese spanish"
cargo --version
rustc --version
# Pin dependencies as required if we are using MSRV toolchain.
# if cargo --version | grep "1\.41"; then
# fi
if cargo --version | grep "1\.41"; then
cargo update --package "bitcoin_hashes" --precise "0.12.0"
fi
echo "********* Testing std *************"
# Test without any features other than std first
@ -19,6 +20,16 @@ echo "********* Testing default *************"
# Then test with the default features
cargo test --verbose
# Build specific features
for feature in ${FEATURES}
do
cargo build --verbose --features="$feature" --no-default-features
done
if cargo --version | grep -v "1\.41"; then
cargo build --verbose --features="zeroize" --no-default-features
fi
if [ "$DO_NO_STD" = true ]
then
echo "********* Testing no-std build *************"
@ -38,6 +49,10 @@ then
do
cargo build --verbose --features="$feature" --no-default-features
done
if cargo --version | grep -v "1\.41"; then
cargo build --verbose --features="zeroize" --no-default-features
fi
fi
# Test each feature

View File

@ -337,10 +337,10 @@ mod tests {
Language::Korean,
];
for lang in languages {
for lang in languages.iter() {
let mut list = lang.word_list().to_vec();
list.sort();
assert_eq!(list, lang.word_list());
assert_eq!(&list[..], &lang.word_list()[..]);
}
}

View File

@ -899,7 +899,7 @@ mod tests {
);
assert_eq!(&entropy, &mnemonic.to_entropy(), "failed vector: {}", mnemonic_str);
assert_eq!(
&entropy,
&entropy[..],
&mnemonic.to_entropy_array().0[0..entropy.len()],
"failed vector: {}",
mnemonic_str