diff options
author | Andrea Corallo <akrl@sdf.org> | 2020-12-06 18:07:27 +0100 |
---|---|---|
committer | Andrea Corallo <akrl@sdf.org> | 2020-12-06 18:07:27 +0100 |
commit | 715a1ca1744f9a5918376bf7662c81302f0b20c0 (patch) | |
tree | e6ea1ac67e88ead92df65087d3f41b8e544f5e86 /test/lisp/subr-tests.el | |
parent | 27f666e111a34d64de81a214024e1e30928b416e (diff) | |
parent | 40e11743ca3803bdc2c6c612f35ab695efb3eb8b (diff) | |
download | emacs-715a1ca1744f9a5918376bf7662c81302f0b20c0.tar.gz emacs-715a1ca1744f9a5918376bf7662c81302f0b20c0.tar.bz2 emacs-715a1ca1744f9a5918376bf7662c81302f0b20c0.zip |
Merge remote-tracking branch 'savannah/master' into HEAD
Diffstat (limited to 'test/lisp/subr-tests.el')
-rw-r--r-- | test/lisp/subr-tests.el | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/test/lisp/subr-tests.el b/test/lisp/subr-tests.el index 9573b98289d..9108e0fe140 100644 --- a/test/lisp/subr-tests.el +++ b/test/lisp/subr-tests.el @@ -551,6 +551,30 @@ See https://debbugs.gnu.org/cgi/bugreport.cgi?bug=19350." (should (equal (replace-regexp-in-string "\\`\\|x" "z" "--xx--") "z--zz--"))) +(ert-deftest subr-match-substitute-replacement () + (with-temp-buffer + (insert "Alpha Beta Gamma Delta Epsilon") + (goto-char (point-min)) + (re-search-forward "B\\(..\\)a") + (should (equal (match-substitute-replacement "carrot") + "Carrot")) + (should (equal (match-substitute-replacement "<\\&>") + "<Beta>")) + (should (equal (match-substitute-replacement "m\\1a") + "Meta")) + (should (equal (match-substitute-replacement "ernin" nil nil nil 1) + "Bernina"))) + (let ((s "Tau Beta Gamma Delta Epsilon")) + (string-match "B\\(..\\)a" s) + (should (equal (match-substitute-replacement "carrot" nil nil s) + "Carrot")) + (should (equal (match-substitute-replacement "<\\&>" nil nil s) + "<Beta>")) + (should (equal (match-substitute-replacement "m\\1a" nil nil s) + "Meta")) + (should (equal (match-substitute-replacement "ernin" nil nil s 1) + "Bernina")))) + (ert-deftest subr-tests--change-group-33341 () (with-temp-buffer (buffer-enable-undo) |