aboutsummaryrefslogtreecommitdiffstats
path: root/test/lisp/replace-tests.el
diff options
context:
space:
mode:
authorStephen Leake2019-09-18 17:43:28 -0700
committerStephen Leake2019-09-18 17:43:28 -0700
commit34f1035e878a06ad181ff7fc533cd1fa0a565847 (patch)
tree7708b0e62b09571ba5b2c625d810cd932c380508 /test/lisp/replace-tests.el
parentb478444099655f36f7b243e21e8f98051299ca8f (diff)
parent107ce3050fc37b9a13d8304ae1bb73fac9de5f61 (diff)
downloademacs-34f1035e878a06ad181ff7fc533cd1fa0a565847.tar.gz
emacs-34f1035e878a06ad181ff7fc533cd1fa0a565847.zip
Merge commit '107ce3050fc37b9a13d8304ae1bb73fac9de5f61'
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