1
1
Fork 0
mirror of https://github.com/NixOS/nix.git synced 2025-11-08 19:46:02 +01:00

shellcheck fix: tests/functional/export.sh

This commit is contained in:
Farid Zakaria 2025-09-25 10:36:12 -07:00
parent 9e3c502521
commit 230da1cbe7
2 changed files with 9 additions and 8 deletions

View file

@ -107,7 +107,6 @@
excludes = [ excludes = [
# We haven't linted these files yet # We haven't linted these files yet
''^tests/functional/dump-db\.sh$'' ''^tests/functional/dump-db\.sh$''
''^tests/functional/export\.sh$''
''^tests/functional/fetchClosure\.sh$'' ''^tests/functional/fetchClosure\.sh$''
''^tests/functional/fetchGit\.sh$'' ''^tests/functional/fetchGit\.sh$''
''^tests/functional/fetchGitRefs\.sh$'' ''^tests/functional/fetchGitRefs\.sh$''

View file

@ -8,11 +8,12 @@ clearStore
outPath=$(nix-build dependencies.nix --no-out-link) outPath=$(nix-build dependencies.nix --no-out-link)
nix-store --export $outPath > $TEST_ROOT/exp nix-store --export "$outPath" > "$TEST_ROOT"/exp
nix-store --export $(nix-store -qR $outPath) > $TEST_ROOT/exp_all # shellcheck disable=SC2046
nix-store --export $(nix-store -qR "$outPath") > "$TEST_ROOT"/exp_all
if nix-store --export $outPath >/dev/full ; then if nix-store --export "$outPath" >/dev/full ; then
echo "exporting to a bad file descriptor should fail" echo "exporting to a bad file descriptor should fail"
exit 1 exit 1
fi fi
@ -20,7 +21,7 @@ fi
clearStore clearStore
if nix-store --import < $TEST_ROOT/exp; then if nix-store --import < "$TEST_ROOT"/exp; then
echo "importing a non-closure should fail" echo "importing a non-closure should fail"
exit 1 exit 1
fi fi
@ -28,13 +29,14 @@ fi
clearStore clearStore
nix-store --import < $TEST_ROOT/exp_all nix-store --import < "$TEST_ROOT"/exp_all
nix-store --export $(nix-store -qR $outPath) > $TEST_ROOT/exp_all2 # shellcheck disable=SC2046
nix-store --export $(nix-store -qR "$outPath") > "$TEST_ROOT"/exp_all2
clearStore clearStore
# Regression test: the derivers in exp_all2 are empty, which shouldn't # Regression test: the derivers in exp_all2 are empty, which shouldn't
# cause a failure. # cause a failure.
nix-store --import < $TEST_ROOT/exp_all2 nix-store --import < "$TEST_ROOT"/exp_all2