forked from lix-project/lix
added test for empty substring special case
This commit is contained in:
parent
25c889baac
commit
1996105e91
1
tests/functional/lang/eval-okay-substring-context.exp
Normal file
1
tests/functional/lang/eval-okay-substring-context.exp
Normal file
|
@ -0,0 +1 @@
|
|||
"okay"
|
11
tests/functional/lang/eval-okay-substring-context.nix
Normal file
11
tests/functional/lang/eval-okay-substring-context.nix
Normal file
|
@ -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"
|
Loading…
Reference in a new issue