aboutsummaryrefslogtreecommitdiff
path: root/tests/pure-eval.sh
diff options
context:
space:
mode:
Diffstat (limited to 'tests/pure-eval.sh')
-rw-r--r--tests/pure-eval.sh5
1 files changed, 4 insertions, 1 deletions
diff --git a/tests/pure-eval.sh b/tests/pure-eval.sh
index c994fbb98..cb4b5c5fc 100644
--- a/tests/pure-eval.sh
+++ b/tests/pure-eval.sh
@@ -6,7 +6,10 @@ 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.currentTime)
(! nix eval --expr builtins.currentSystem)