emacs-elpa-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[nongnu] elpa/evil-surround a3803cfb51 141/175: Add a test for surroundi


From: ELPA Syncer
Subject: [nongnu] elpa/evil-surround a3803cfb51 141/175: Add a test for surrounding with a tag in a macro
Date: Mon, 9 Oct 2023 13:01:10 -0400 (EDT)

branch: elpa/evil-surround
commit a3803cfb514180de3ce14727b293afd92e10f4bd
Author: James N. V. Cash <james.nvc@gmail.com>
Commit: James N. V. Cash <james.nvc@gmail.com>

    Add a test for surrounding with a tag in a macro
    
    Not using `evil-test-buffer`, as it doesn't seem to play well with
    this kind of testing a kbd macro.
    
    Also slightly different from the already-present tests for surrounding
    with tags, because it does additional things after wrapping -- without
    the included change, this surrounds with a `<div>` tag, but also
    inserts the following keys as well, instead of treating them as
    commands.
---
 test/evil-surround-test.el | 15 +++++++++++++++
 1 file changed, 15 insertions(+)

diff --git a/test/evil-surround-test.el b/test/evil-surround-test.el
index 0ab98de36e..763aa447e8 100644
--- a/test/evil-surround-test.el
+++ b/test/evil-surround-test.el
@@ -243,3 +243,18 @@
      "[w]ord"
      ("ysiwb")
      "[(]word)")))
+
+(ert-deftest evil-surround-tag-from-macro ()
+ (ert-info ("tag surround in macro")
+   (save-window-excursion
+     (with-current-buffer (get-buffer-create "*evil-surround-tag-from-macro*")
+       (switch-to-buffer-other-window (current-buffer))
+       (insert "foo\nbar\nbaz\n")
+       (goto-char (point-min))
+       (evil-mode 1)
+       (turn-on-evil-surround-mode)
+       (execute-kbd-macro
+        "yse<div>f>lysit$j_")
+       (should
+        (string= "<div>$foo$</div>\nbar\nbaz\n"
+                 (buffer-substring-no-properties (point-min) (point-max))))))))



reply via email to

[Prev in Thread] Current Thread [Next in Thread]