Merge pull request #10827 from SkamDart/skamdart/functional-add-sc

housekeeping: shellcheck test/functional/add.sh
This commit is contained in:
Robert Hensing 2024-06-03 12:31:39 +02:00 committed by GitHub
commit f8bd4ba561
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 7 additions and 8 deletions

View file

@ -507,7 +507,6 @@
''^scripts/install-nix-from-closure\.sh$'' ''^scripts/install-nix-from-closure\.sh$''
''^scripts/install-systemd-multi-user\.sh$'' ''^scripts/install-systemd-multi-user\.sh$''
''^src/nix/get-env\.sh$'' ''^src/nix/get-env\.sh$''
''^tests/functional/add\.sh$''
''^tests/functional/bash-profile\.sh$'' ''^tests/functional/bash-profile\.sh$''
''^tests/functional/binary-cache-build-remote\.sh$'' ''^tests/functional/binary-cache-build-remote\.sh$''
''^tests/functional/binary-cache\.sh$'' ''^tests/functional/binary-cache\.sh$''

View file

@ -3,10 +3,10 @@
source common.sh source common.sh
path1=$(nix-store --add ./dummy) path1=$(nix-store --add ./dummy)
echo $path1 echo "$path1"
path2=$(nix-store --add-fixed sha256 --recursive ./dummy) path2=$(nix-store --add-fixed sha256 --recursive ./dummy)
echo $path2 echo "$path2"
if test "$path1" != "$path2"; then if test "$path1" != "$path2"; then
echo "nix-store --add and --add-fixed mismatch" echo "nix-store --add and --add-fixed mismatch"
@ -14,18 +14,18 @@ if test "$path1" != "$path2"; then
fi fi
path3=$(nix-store --add-fixed sha256 ./dummy) path3=$(nix-store --add-fixed sha256 ./dummy)
echo $path3 echo "$path3"
test "$path1" != "$path3" || exit 1 test "$path1" != "$path3" || exit 1
path4=$(nix-store --add-fixed sha1 --recursive ./dummy) path4=$(nix-store --add-fixed sha1 --recursive ./dummy)
echo $path4 echo "$path4"
test "$path1" != "$path4" || exit 1 test "$path1" != "$path4" || exit 1
hash1=$(nix-store -q --hash $path1) hash1=$(nix-store -q --hash "$path1")
echo $hash1 echo "$hash1"
hash2=$(nix-hash --type sha256 --base32 ./dummy) hash2=$(nix-hash --type sha256 --base32 ./dummy)
echo $hash2 echo "$hash2"
test "$hash1" = "sha256:$hash2" test "$hash1" = "sha256:$hash2"