summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorGlenn Morris <rgm@gnu.org>2019-09-15 16:38:23 -0700
committerGlenn Morris <rgm@gnu.org>2019-09-15 16:38:23 -0700
commita625ca5c2675a41c5c0d277def6b8cb4f4c4d6db (patch)
tree80a22e6d963bd93ba62c6df48e26aec7eecbbfa4 /test
parent211dc01a7bfac81281fa80e45e21157fc0c25b26 (diff)
parent30c4f35a6fc8a6507930923766c3126ac1c2063f (diff)
downloademacs-a625ca5c2675a41c5c0d277def6b8cb4f4c4d6db.tar.gz
Merge from origin/emacs-26
30c4f35 (origin/emacs-26) query-replace-regexp undo: Update next-repl... c596be0 Amend the menu caption for page "Display Property" in the Eli... 13b9510 Add description of chinese-sisheng
Diffstat (limited to 'test')
-rw-r--r--test/lisp/replace-tests.el18
1 files changed, 17 insertions, 1 deletions
diff --git a/test/lisp/replace-tests.el b/test/lisp/replace-tests.el
index f7bf2d93658..f42d47c2bfb 100644
--- a/test/lisp/replace-tests.el
+++ b/test/lisp/replace-tests.el
@@ -514,7 +514,9 @@ Return the last evalled form in BODY."
(should
(replace-tests-with-undo
input "theorem \\([0-9]+\\)"
- "theorem \\\\ref{theo_\\1}"
+ '(replace-eval-replacement
+ replace-quote
+ (format "theorem \\\\ref{theo_%d}" (1+ (string-to-number (match-string 1)))))
((?\s . (1 2)) (?U . (3)))
?q
(string= input (buffer-string)))))
@@ -530,4 +532,18 @@ Return the last evalled form in BODY."
?q
(string= expected (buffer-string))))))
+(ert-deftest query-replace-undo-bug37287 ()
+ "Test for https://debbugs.gnu.org/37287 ."
+ (let ((input "foo-1\nfoo-2\nfoo-3")
+ (expected "foo-2\nfoo-2\nfoo-3"))
+ (should
+ (replace-tests-with-undo
+ input "\\([0-9]\\)"
+ '(replace-eval-replacement
+ replace-quote
+ (format "%d" (1+ (string-to-number (match-string 1)))))
+ ((?\s . (1 2 4)) (?U . (3)))
+ ?q
+ (string= expected (buffer-string))))))
+
;;; replace-tests.el ends here