Skip to content

Commit

Permalink
added test for empty substring special case
Browse files Browse the repository at this point in the history
  • Loading branch information
bacchanalia committed Jan 12, 2024
1 parent 25c889b commit 1996105
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 0 deletions.
1 change: 1 addition & 0 deletions tests/functional/lang/eval-okay-substring-context.exp
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
"okay"
11 changes: 11 additions & 0 deletions tests/functional/lang/eval-okay-substring-context.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
with builtins;

let

s = "${builtins.derivation { name = "test"; builder = "/bin/sh"; system = "x86_64-linux"; }}";

in

if getContext s == getContext "${substring 0 0 s + unsafeDiscardStringContext s}"
then "okay"
else throw "empty substring should preserve context"

0 comments on commit 1996105

Please sign in to comment.