emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

master 72e9ec9 1/3: ; * test/lisp/subr-tests.el (string-replace): Add mo


From: Mattias Engdegård
Subject: master 72e9ec9 1/3: ; * test/lisp/subr-tests.el (string-replace): Add more test cases
Date: Sun, 27 Sep 2020 08:45:22 -0400 (EDT)

branch: master
commit 72e9ec96d0e68f57d5b357595e6dfb76114d8506
Author: Mattias Engdegård <mattiase@acm.org>
Commit: Mattias Engdegård <mattiase@acm.org>

    ; * test/lisp/subr-tests.el (string-replace): Add more test cases
---
 test/lisp/subr-tests.el | 13 +++++++++++++
 1 file changed, 13 insertions(+)

diff --git a/test/lisp/subr-tests.el b/test/lisp/subr-tests.el
index 42dcf38..035c064 100644
--- a/test/lisp/subr-tests.el
+++ b/test/lisp/subr-tests.el
@@ -468,6 +468,19 @@ See https://debbugs.gnu.org/cgi/bugreport.cgi?bug=19350.";
                  "axb"))
   (should (equal (string-replace "\377" "x" "a\377ø")
                  "axø"))
+  (should (equal (string-replace (string-to-multibyte "\377") "x" "a\377b")
+                 "axb"))
+  (should (equal (string-replace (string-to-multibyte "\377") "x" "a\377ø")
+                 "axø"))
+
+  (should (equal (string-replace "ana" "ANA" "ananas") "ANAnas"))
+
+  (should (equal (string-replace "a" "" "") ""))
+  (should (equal (string-replace "a" "" "aaaaa") ""))
+  (should (equal (string-replace "ab" "" "ababab") ""))
+  (should (equal (string-replace "ab" "" "abcabcabc") "ccc"))
+  (should (equal (string-replace "a" "aa" "aaa") "aaaaaa"))
+  (should (equal (string-replace "abc" "defg" "abc") "defg"))
 
   (should-error (string-replace "" "x" "abc")))
 



reply via email to

[Prev in Thread] Current Thread [Next in Thread]