aboutsummaryrefslogtreecommitdiffstats
path: root/test/lisp/replace-tests.el
diff options
context:
space:
mode:
Diffstat (limited to 'test/lisp/replace-tests.el')
-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."
514 (should 514 (should
515 (replace-tests-with-undo 515 (replace-tests-with-undo
516 input "theorem \\([0-9]+\\)" 516 input "theorem \\([0-9]+\\)"
517 "theorem \\\\ref{theo_\\1}" 517 '(replace-eval-replacement
518 replace-quote
519 (format "theorem \\\\ref{theo_%d}" (1+ (string-to-number (match-string 1)))))
518 ((?\s . (1 2)) (?U . (3))) 520 ((?\s . (1 2)) (?U . (3)))
519 ?q 521 ?q
520 (string= input (buffer-string))))) 522 (string= input (buffer-string)))))
@@ -530,4 +532,18 @@ Return the last evalled form in BODY."
530 ?q 532 ?q
531 (string= expected (buffer-string)))))) 533 (string= expected (buffer-string))))))
532 534
535(ert-deftest query-replace-undo-bug37287 ()
536 "Test for https://debbugs.gnu.org/37287 ."
537 (let ((input "foo-1\nfoo-2\nfoo-3")
538 (expected "foo-2\nfoo-2\nfoo-3"))
539 (should
540 (replace-tests-with-undo
541 input "\\([0-9]\\)"
542 '(replace-eval-replacement
543 replace-quote
544 (format "%d" (1+ (string-to-number (match-string 1)))))
545 ((?\s . (1 2 4)) (?U . (3)))
546 ?q
547 (string= expected (buffer-string))))))
548
533;;; replace-tests.el ends here 549;;; replace-tests.el ends here