diff options
| author | Nick Drozd | 2021-01-20 02:46:17 +0100 |
|---|---|---|
| committer | Lars Ingebrigtsen | 2021-01-20 02:46:17 +0100 |
| commit | 5536893c6e629d9541c75a1b0b239eaa96c6eaeb (patch) | |
| tree | 4d9b0b3fe42c955ba7b56a63b3ef41ed9ea83c20 | |
| parent | 8ed97a8d543b9596166c670212265dabc44aa3d5 (diff) | |
| download | emacs-5536893c6e629d9541c75a1b0b239eaa96c6eaeb.tar.gz emacs-5536893c6e629d9541c75a1b0b239eaa96c6eaeb.zip | |
test/lisp/replace-tests.el: Add nested match group test
* test/lisp/replace-tests.el (replace-regexp-bug45973): Add test
(bug#45973).
| -rw-r--r-- | test/lisp/replace-tests.el | 13 |
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." | |||
| 587 | (get-text-property (point) 'occur-target)) | 587 | (get-text-property (point) 'occur-target)) |
| 588 | (should (funcall check-overlays has-overlay))))))) | 588 | (should (funcall check-overlays has-overlay))))))) |
| 589 | 589 | ||
| 590 | (ert-deftest replace-regexp-bug45973 () | ||
| 591 | "Test for https://debbugs.gnu.org/45973 ." | ||
| 592 | (let ((before "1RB 1LC 1RC 1RB 1RD 0LE 1LA 1LD 1RH 0LA") | ||
| 593 | (after "1LB 1RC 1LC 1LB 1LD 0RE 1RA 1RD 1LH 0RA")) | ||
| 594 | (with-temp-buffer | ||
| 595 | (insert before) | ||
| 596 | (goto-char (point-min)) | ||
| 597 | (replace-regexp | ||
| 598 | "\\(\\(L\\)\\|\\(R\\)\\)" | ||
| 599 | '(replace-eval-replacement | ||
| 600 | replace-quote | ||
| 601 | (if (match-string 2) "R" "L"))) | ||
| 602 | (should (equal (buffer-string) after))))) | ||
| 590 | 603 | ||
| 591 | ;;; replace-tests.el ends here | 604 | ;;; replace-tests.el ends here |