aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--tests/functional/nar-access.sh5
1 files changed, 5 insertions, 0 deletions
diff --git a/tests/functional/nar-access.sh b/tests/functional/nar-access.sh
index d487d58d2..426068e68 100644
--- a/tests/functional/nar-access.sh
+++ b/tests/functional/nar-access.sh
@@ -25,6 +25,11 @@ diff -u baz.cat-nar $storePath/foo/baz
nix store cat $storePath/foo/baz > baz.cat-nar
diff -u baz.cat-nar $storePath/foo/baz
+# Check that 'nix store cat' fails on invalid store paths.
+invalidPath="$(dirname $storePath)/99999999999999999999999999999999-foo"
+cp -r $storePath $invalidPath
+expect 1 nix store cat $invalidPath/foo/baz
+
# Test --json.
diff -u \
<(nix nar ls --json $narFile / | jq -S) \