about summary refs log tree commit diff
path: root/tvix/eval/src
diff options
context:
space:
mode:
Diffstat (limited to 'tvix/eval/src')
-rw-r--r--tvix/eval/src/builtins/mod.rs2
-rw-r--r--tvix/eval/src/tests/tvix_tests/eval-okay-builtins-replaceStrings.exp2
-rw-r--r--tvix/eval/src/tests/tvix_tests/eval-okay-builtins-replaceStrings.nix1
3 files changed, 3 insertions, 2 deletions
diff --git a/tvix/eval/src/builtins/mod.rs b/tvix/eval/src/builtins/mod.rs
index d0c5bf5568b9..d701fa08a08d 100644
--- a/tvix/eval/src/builtins/mod.rs
+++ b/tvix/eval/src/builtins/mod.rs
@@ -723,7 +723,7 @@ mod pure_builtins {
                 let from = elem.0.to_str()?;
                 let to = elem.1.to_str()?;
 
-                if i + from.len() >= string.len() {
+                if i + from.len() > string.len() {
                     continue;
                 }
 
diff --git a/tvix/eval/src/tests/tvix_tests/eval-okay-builtins-replaceStrings.exp b/tvix/eval/src/tests/tvix_tests/eval-okay-builtins-replaceStrings.exp
index c2cb89bac663..9f20496c7aa0 100644
--- a/tvix/eval/src/tests/tvix_tests/eval-okay-builtins-replaceStrings.exp
+++ b/tvix/eval/src/tests/tvix_tests/eval-okay-builtins-replaceStrings.exp
@@ -1 +1 @@
-[ "fabir" "a" "1a1" ]
+[ "fabir" "a" "1a1" "ABC" ]
diff --git a/tvix/eval/src/tests/tvix_tests/eval-okay-builtins-replaceStrings.nix b/tvix/eval/src/tests/tvix_tests/eval-okay-builtins-replaceStrings.nix
index b8101c448bb0..24a58996094a 100644
--- a/tvix/eval/src/tests/tvix_tests/eval-okay-builtins-replaceStrings.nix
+++ b/tvix/eval/src/tests/tvix_tests/eval-okay-builtins-replaceStrings.nix
@@ -2,4 +2,5 @@
   (builtins.replaceStrings ["oo" "a"] ["a" "i"] "foobar")
   (builtins.replaceStrings ["o"] ["a"] "a")
   (builtins.replaceStrings ["" ""] ["1" "2"] "a")
+  (builtins.replaceStrings ["a" "b" "c"] ["A" "B" "C"] "abc")
 ]