summaryrefslogtreecommitdiff
path: root/test/lisp/replace-tests.el
diff options
context:
space:
mode:
authorSean Whitton <spwhitton@spwhitton.name>2021-01-31 22:34:48 -0700
committerSean Whitton <spwhitton@spwhitton.name>2021-01-31 22:34:48 -0700
commitd4d613629b59d2eadd80026cab6c9dabc92cab24 (patch)
treed31086a817251dddb847d027661d218c1ecd6540 /test/lisp/replace-tests.el
parentfdb813e529602914360fc2d0cf22e42e32e6905f (diff)
parenta5438ee11ad052e71334dcfb2db51fb9123411e5 (diff)
downloademacs-d4d613629b59d2eadd80026cab6c9dabc92cab24.tar.gz
Merge remote-tracking branch 'origin/master' into athena/unstable
Diffstat (limited to 'test/lisp/replace-tests.el')
-rw-r--r--test/lisp/replace-tests.el13
1 files changed, 13 insertions, 0 deletions
diff --git a/test/lisp/replace-tests.el b/test/lisp/replace-tests.el
index 8c2682a1f13..2db570c97dd 100644
--- a/test/lisp/replace-tests.el
+++ b/test/lisp/replace-tests.el
@@ -587,5 +587,18 @@ bound to HIGHLIGHT-LOCUS."
(get-text-property (point) 'occur-target))
(should (funcall check-overlays has-overlay)))))))
+(ert-deftest replace-regexp-bug45973 ()
+ "Test for https://debbugs.gnu.org/45973 ."
+ (let ((before "1RB 1LC 1RC 1RB 1RD 0LE 1LA 1LD 1RH 0LA")
+ (after "1LB 1RC 1LC 1LB 1LD 0RE 1RA 1RD 1LH 0RA"))
+ (with-temp-buffer
+ (insert before)
+ (goto-char (point-min))
+ (replace-regexp
+ "\\(\\(L\\)\\|\\(R\\)\\)"
+ '(replace-eval-replacement
+ replace-quote
+ (if (match-string 2) "R" "L")))
+ (should (equal (buffer-string) after)))))
;;; replace-tests.el ends here