diff options
Diffstat (limited to 'tests/pure-eval.sh')
-rw-r--r-- | tests/pure-eval.sh | 8 |
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) |