summary refs log tree commit diff
path: root/tests
diff options
context:
space:
mode:
Diffstat (limited to 'tests')
-rw-r--r--tests/utils.scm8
1 files changed, 8 insertions, 0 deletions
diff --git a/tests/utils.scm b/tests/utils.scm
index 4f6ecc514d..017d9170fa 100644
--- a/tests/utils.scm
+++ b/tests/utils.scm
@@ -82,6 +82,14 @@
         (string-tokenize* "foo!bar!" "!")
         (string-tokenize* "foo+-+bar+-+baz" "+-+")))
 
+(test-equal "string-replace-substring"
+  '("foo BAR! baz"
+    "/gnu/store/chbouib"
+    "")
+  (list (string-replace-substring "foo bar baz" "bar" "BAR!")
+        (string-replace-substring "/nix/store/chbouib" "/nix/" "/gnu/")
+        (string-replace-substring "" "foo" "bar")))
+
 (test-equal "fold2, 1 list"
     (list (reverse (iota 5))
           (map - (reverse (iota 5))))