From 9659940659b36ffab3cbd1eff9f343c9ada2491b Mon Sep 17 00:00:00 2001 From: Eelco Dolstra Date: Wed, 12 Feb 2020 10:33:16 +0100 Subject: [PATCH] Test narHash mismatch --- tests/tarball.sh | 1 + 1 file changed, 1 insertion(+) diff --git a/tests/tarball.sh b/tests/tarball.sh index 7c8896b2e..f43bd6e71 100644 --- a/tests/tarball.sh +++ b/tests/tarball.sh @@ -30,6 +30,7 @@ test_tarball() { nix-build -o $TEST_ROOT/result -E "import (fetchTree file://$tarball)" nix-build -o $TEST_ROOT/result -E "import (fetchTree { type = \"tarball\"; url = file://$tarball; })" nix-build -o $TEST_ROOT/result -E "import (fetchTree { type = \"tarball\"; url = file://$tarball; narHash = \"$hash\"; })" + nix-build -o $TEST_ROOT/result -E "import (fetchTree { type = \"tarball\"; url = file://$tarball; narHash = \"sha256-xdKv2pq/IiwLSnBBJXW8hNowI4MrdZfW+SYqDQs7Tzc=\"; })" 2>&1 | grep 'NAR hash mismatch in input' nix-instantiate --eval -E '1 + 2' -I fnord=file://no-such-tarball.tar$ext nix-instantiate --eval -E 'with ; 1 + 2' -I fnord=file://no-such-tarball$ext