added test for empty substring special case

This commit is contained in:
Mel Zuser 2024-01-12 08:57:08 -08:00
parent 25c889baac
commit 1996105e91
2 changed files with 12 additions and 0 deletions

View file

@ -0,0 +1 @@
"okay"

View 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"