hash.sh: Make failure tests more tolerant of additional output

"warning: you don'\''t have Internet access; disabling some network-dependent features" ...

https://github.com/NixOS/nix/issues/8876
This commit is contained in:
Peter Kolloch 2023-12-02 18:19:51 +01:00
parent bbba2055f0
commit e9a5365db6

View File

@ -173,11 +173,11 @@ try3() {
#
fail=$(nix hash convert --algo "$1" --from nix32 "$2" 2>&1 || echo "exit: $?")
[[ "$fail" == "error: input hash"*"exit: 1" ]]
[[ "$fail" == *"error: input hash"*"exit: 1" ]]
fail=$(nix hash convert --algo "$1" --from base16 "$3" 2>&1 || echo "exit: $?")
[[ "$fail" == "error: input hash"*"exit: 1" ]]
[[ "$fail" == *"error: input hash"*"exit: 1" ]]
fail=$(nix hash convert --algo "$1" --from nix32 "$4" 2>&1 || echo "exit: $?")
[[ "$fail" == "error: input hash"*"exit: 1" ]]
[[ "$fail" == *"error: input hash"*"exit: 1" ]]
}