diff options
Diffstat (limited to 'test/testdata/eval-okay-substring-context.nix')
-rw-r--r-- | test/testdata/eval-okay-substring-context.nix | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/test/testdata/eval-okay-substring-context.nix b/test/testdata/eval-okay-substring-context.nix new file mode 100644 index 0000000..d0ef70d --- /dev/null +++ b/test/testdata/eval-okay-substring-context.nix | |||
@@ -0,0 +1,11 @@ | |||
1 | with builtins; | ||
2 | |||
3 | let | ||
4 | |||
5 | s = "${builtins.derivation { name = "test"; builder = "/bin/sh"; system = "x86_64-linux"; }}"; | ||
6 | |||
7 | in | ||
8 | |||
9 | if getContext s == getContext "${substring 0 0 s + unsafeDiscardStringContext s}" | ||
10 | then "okay" | ||
11 | else throw "empty substring should preserve context" | ||