about summary refs log tree commit diff
path: root/tests/lang
diff options
context:
space:
mode:
Diffstat (limited to 'tests/lang')
-rw-r--r--tests/lang/eval-okay-context.exp1
-rw-r--r--tests/lang/eval-okay-context.nix6
2 files changed, 7 insertions, 0 deletions
diff --git a/tests/lang/eval-okay-context.exp b/tests/lang/eval-okay-context.exp
new file mode 100644
index 000000000000..95a993654263
--- /dev/null
+++ b/tests/lang/eval-okay-context.exp
@@ -0,0 +1 @@
+Str("foo eval-okay-context.nix bar",[])
diff --git a/tests/lang/eval-okay-context.nix b/tests/lang/eval-okay-context.nix
new file mode 100644
index 000000000000..b3f1748975f7
--- /dev/null
+++ b/tests/lang/eval-okay-context.nix
@@ -0,0 +1,6 @@
+let s = "foo ${builtins.substring 33 100 (baseNameOf ./eval-okay-context.nix)} bar";
+in
+  if s == "foo eval-okay-context.nix bar"
+  then abort "context not discarded"
+  else builtins.unsafeDiscardStringContext s
+