aboutsummaryrefslogtreecommitdiff
path: root/tests/pure-eval.sh
diff options
context:
space:
mode:
authorJohn Ericson <John.Ericson@Obsidian.Systems>2022-03-10 15:48:14 +0000
committerJohn Ericson <John.Ericson@Obsidian.Systems>2022-03-10 15:48:14 +0000
commit8ba089597fa19bfd49ba5f22a5e821740ca4eb5d (patch)
treeb4f2299b9c973ef7636f8ce1bab0299dee4cc389 /tests/pure-eval.sh
parent13b6b645897fd2edaa0f09fa48d6fe8dd6287b55 (diff)
parent4d98143914120d0163f5c50f30ce8a5289433f8f (diff)
Merge remote-tracking branch 'upstream/master' into path-info
Diffstat (limited to 'tests/pure-eval.sh')
-rw-r--r--tests/pure-eval.sh8
1 files changed, 7 insertions, 1 deletions
diff --git a/tests/pure-eval.sh b/tests/pure-eval.sh
index c994fbb98..1a4568ea6 100644
--- a/tests/pure-eval.sh
+++ b/tests/pure-eval.sh
@@ -6,7 +6,13 @@ nix eval --expr 'assert 1 + 2 == 3; true'
[[ $(nix eval --impure --expr 'builtins.readFile ./pure-eval.sh') =~ clearStore ]]
-(! nix eval --expr 'builtins.readFile ./pure-eval.sh')
+missingImpureErrorMsg=$(! nix eval --expr 'builtins.readFile ./pure-eval.sh' 2>&1)
+
+echo "$missingImpureErrorMsg" | grep -q -- --impure || \
+ fail "The error message should mention the “--impure” flag to unblock users"
+
+[[ $(nix eval --expr 'builtins.pathExists ./pure-eval.sh') == false ]] || \
+ fail "Calling 'pathExists' on a non-authorised path should return false"
(! nix eval --expr builtins.currentTime)
(! nix eval --expr builtins.currentSystem)