mirror of
https://github.com/privatevoid-net/nix-super.git
synced 2024-11-22 05:56:15 +02:00
added test for empty substring special case
This commit is contained in:
parent
25c889baac
commit
1996105e91
2 changed files with 12 additions and 0 deletions
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