Add Entry::{or_default, and_modify}
[anymap] / test
1 #!/bin/sh
2 set -e
3 export RUSTFLAGS="-D warnings"
4 export RUSTDOCFLAGS="-D warnings"
5 run_tests() {
6 for release in "" "--release"; do
7 cargo $1 test $release --no-default-features --features hashbrown
8 cargo $1 test $release --features hashbrown
9 # (2>/dev/null because otherwise you’ll keep seeing errors and double-guessing whether they were supposed to happen or whether the script failed to exit nonzero.)
10 ! 2>/dev/null cargo $1 test $release --no-default-features || ! echo "'cargo $1 test $release --no-default-features' failed to fail (sorry, its stderr is suppressed, try it manually)"
11 cargo $1 test $release
12 done
13 }
14
15 # We’d like to test with the oldest declared-supported version of *all* our dependencies.
16 # That means Rust 1.36.0 + hashbrown 0.1.1.
17 # Hence the different lock file.
18 # (Also Rust 1.36.0 can’t read the latest lock file format.)
19 cp test-oldest-Cargo.lock Cargo.lock
20 run_tests +1.36.0
21 rm Cargo.lock
22 run_tests
23
24 cargo clippy
25 cargo bench
26 cargo doc