aboutsummaryrefslogtreecommitdiffstats
path: root/test/testdata/eval-okay-substring-context.nix
diff options
context:
space:
mode:
authorRutger Broekhoff2025-07-07 21:52:08 +0200
committerRutger Broekhoff2025-07-07 21:52:08 +0200
commitba61dfd69504ec6263a9dee9931d93adeb6f3142 (patch)
treed6c9b78e50eeab24e0c1c09ab45909a6ae3fd5db /test/testdata/eval-okay-substring-context.nix
downloadverified-dyn-lang-interp-ba61dfd69504ec6263a9dee9931d93adeb6f3142.tar.gz
verified-dyn-lang-interp-ba61dfd69504ec6263a9dee9931d93adeb6f3142.zip
Initialize repository
Diffstat (limited to 'test/testdata/eval-okay-substring-context.nix')
-rw-r--r--test/testdata/eval-okay-substring-context.nix11
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 @@
1with builtins;
2
3let
4
5 s = "${builtins.derivation { name = "test"; builder = "/bin/sh"; system = "x86_64-linux"; }}";
6
7in
8
9if getContext s == getContext "${substring 0 0 s + unsafeDiscardStringContext s}"
10then "okay"
11else throw "empty substring should preserve context"