nixpkgs mirror (for testing) github.com/NixOS/nixpkgs
nix
at devShellTools-shell 30 lines 598 B view raw
1expectFilePresent () { 2 if [ -f "$1" ]; then 3 echo "Test passed: file is present - $1" 4 else 5 echo "Test failed: file is absent - $1" 6 exit 1 7 fi 8} 9 10expectFileOrDirAbsent () { 11 if [ ! -e "$1" ]; 12 then 13 echo "Test passed: file or dir is absent - $1" 14 else 15 echo "Test failed: file or dir is present - $1" 16 exit 1 17 fi 18} 19 20expectEqual () { 21 if [ "$1" == "$2" ]; 22 then 23 echo "Test passed: output is equal to expected_output" 24 else 25 echo "Test failed: output is not equal to expected_output:" 26 echo " output - $1" 27 echo " expected_output - $2" 28 exit 1 29 fi 30}