mirror of
https://github.com/NixOS/nix.git
synced 2024-11-22 06:42:28 +00:00
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 New Issue
Block a user