From baf331e40c08155082e255372d7cc3c9d63aa3c8 Mon Sep 17 00:00:00 2001 From: Lars Ingebrigtsen Date: Sun, 27 Sep 2020 00:24:50 +0200 Subject: Rename replace-in-string to string-replace * doc/lispref/searching.texi (Search and Replace): Update. * lisp/bindings.el (mode-line-position): Update callers. * lisp/subr.el (string-replace): Rename from replace-in-string since that clashes with XEmacs' replace-in-string which is equivalent to the Emacs replace-regexp-in-string (bug#43598). --- test/lisp/subr-tests.el | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) (limited to 'test/lisp/subr-tests.el') diff --git a/test/lisp/subr-tests.el b/test/lisp/subr-tests.el index 505408fa110..a3e9c426db5 100644 --- a/test/lisp/subr-tests.el +++ b/test/lisp/subr-tests.el @@ -440,33 +440,33 @@ See https://debbugs.gnu.org/cgi/bugreport.cgi?bug=19350." (should-error (ignore-error foo (read "")))) -(ert-deftest replace-in-string () - (should (equal (replace-in-string "foo" "bar" "zot") +(ert-deftest string-replace () + (should (equal (string-replace "foo" "bar" "zot") "zot")) - (should (equal (replace-in-string "foo" "bar" "foozot") + (should (equal (string-replace "foo" "bar" "foozot") "barzot")) - (should (equal (replace-in-string "foo" "bar" "barfoozot") + (should (equal (string-replace "foo" "bar" "barfoozot") "barbarzot")) - (should (equal (replace-in-string "zot" "bar" "barfoozot") + (should (equal (string-replace "zot" "bar" "barfoozot") "barfoobar")) - (should (equal (replace-in-string "z" "bar" "barfoozot") + (should (equal (string-replace "z" "bar" "barfoozot") "barfoobarot")) - (should (equal (replace-in-string "zot" "bar" "zat") + (should (equal (string-replace "zot" "bar" "zat") "zat")) - (should (equal (replace-in-string "azot" "bar" "zat") + (should (equal (string-replace "azot" "bar" "zat") "zat")) - (should (equal (replace-in-string "azot" "bar" "azot") + (should (equal (string-replace "azot" "bar" "azot") "bar")) - (should (equal (replace-in-string "azot" "bar" "foozotbar") + (should (equal (string-replace "azot" "bar" "foozotbar") "foozotbar")) - (should (equal (replace-in-string "\377" "x" "a\377b") + (should (equal (string-replace "\377" "x" "a\377b") "axb")) - (should (equal (replace-in-string "\377" "x" "a\377ø") + (should (equal (string-replace "\377" "x" "a\377ø") "axø")) - (should-error (replace-in-string "" "x" "abc"))) + (should-error (string-replace "" "x" "abc"))) (provide 'subr-tests) ;;; subr-tests.el ends here -- cgit v1.2.3