diff options
Diffstat (limited to 'tvix/eval/src/tests/tvix_tests')
-rw-r--r-- | tvix/eval/src/tests/tvix_tests/eval-okay-builtins-string-length.exp | 1 | ||||
-rw-r--r-- | tvix/eval/src/tests/tvix_tests/eval-okay-builtins-string-length.nix | 10 |
2 files changed, 11 insertions, 0 deletions
diff --git a/tvix/eval/src/tests/tvix_tests/eval-okay-builtins-string-length.exp b/tvix/eval/src/tests/tvix_tests/eval-okay-builtins-string-length.exp new file mode 100644 index 000000000000..b019be4bfd7a --- /dev/null +++ b/tvix/eval/src/tests/tvix_tests/eval-okay-builtins-string-length.exp @@ -0,0 +1 @@ +[ 3 "hello" 9 4 ] diff --git a/tvix/eval/src/tests/tvix_tests/eval-okay-builtins-string-length.nix b/tvix/eval/src/tests/tvix_tests/eval-okay-builtins-string-length.nix new file mode 100644 index 000000000000..b7d51db3c578 --- /dev/null +++ b/tvix/eval/src/tests/tvix_tests/eval-okay-builtins-string-length.nix @@ -0,0 +1,10 @@ +[ + (builtins.stringLength "foo") + (let s = "hello"; in (builtins.substring 0 (builtins.stringLength s) s)) + (builtins.stringLength ("foo" + "${"bar" + "baz"}")) + + # feel free to delete this test case at any time, it's just to show: This is a + # thing at the moment. We may want to break compatibility with this aspect of + # the C++ Nix implementation at any time. + (builtins.stringLength "๐") +] |