aboutsummaryrefslogtreecommitdiff
path: root/tests/fixed.sh
diff options
context:
space:
mode:
Diffstat (limited to 'tests/fixed.sh')
-rw-r--r--tests/fixed.sh13
1 files changed, 10 insertions, 3 deletions
diff --git a/tests/fixed.sh b/tests/fixed.sh
index cac3f0be9..8f51403a7 100644
--- a/tests/fixed.sh
+++ b/tests/fixed.sh
@@ -5,15 +5,22 @@ clearStore
export IMPURE_VAR1=foo
export IMPURE_VAR2=bar
+path=$(nix-store -q $(nix-instantiate fixed.nix -A good.0))
+
+echo 'testing bad...'
+nix-build fixed.nix -A bad --no-out-link && fail "should fail"
+
+# Building with the bad hash should produce the "good" output path as
+# a side-effect.
+[[ -e $path ]]
+nix path-info --json $path | grep fixed:md5:2qk15sxzzjlnpjk9brn7j8ppcd
+
echo 'testing good...'
nix-build fixed.nix -A good --no-out-link
echo 'testing good2...'
nix-build fixed.nix -A good2 --no-out-link
-echo 'testing bad...'
-nix-build fixed.nix -A bad --no-out-link && fail "should fail"
-
echo 'testing reallyBad...'
nix-instantiate fixed.nix -A reallyBad && fail "should fail"