diff options
author | regnat <rg@regnat.ovh> | 2021-12-23 10:35:09 +0100 |
---|---|---|
committer | regnat <rg@regnat.ovh> | 2021-12-23 10:49:33 +0100 |
commit | dc89dfa7b3f8fa7368cd4c5e20891e60e418722b (patch) | |
tree | adfec92a6cc1208a01a2a5f66709c9ec93b7b18b /tests/pure-eval.sh | |
parent | 7feb741e002a7ae108858fcafe67e1f429862775 (diff) |
Properly return false on `builtins.pathExists /someNonAllowedPath`
Follow-up from https://github.com/NixOS/nix/pull/5807 to fix https://github.com/NixOS/nix/pull/5807#issuecomment-1000135394
Diffstat (limited to 'tests/pure-eval.sh')
-rw-r--r-- | tests/pure-eval.sh | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/tests/pure-eval.sh b/tests/pure-eval.sh index cb4b5c5fc..1a4568ea6 100644 --- a/tests/pure-eval.sh +++ b/tests/pure-eval.sh @@ -11,6 +11,9 @@ missingImpureErrorMsg=$(! nix eval --expr 'builtins.readFile ./pure-eval.sh' 2>& 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) |