summaryrefslogtreecommitdiff
path: root/test/evil-surround-test.el
diff options
context:
space:
mode:
authorJames N. V. Cash <james.nvc@gmail.com>2019-12-13 10:42:27 -0500
committerJames N. V. Cash <james.nvc@gmail.com>2019-12-13 10:42:27 -0500
commita3803cfb514180de3ce14727b293afd92e10f4bd (patch)
treea1d3a72d91110f9e876c080adb27153ceeb8e4e7 /test/evil-surround-test.el
parentd210e1fc2cf1c2d095471cefa700a0d1703f4ab6 (diff)
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.
Diffstat (limited to 'test/evil-surround-test.el')
-rw-r--r--test/evil-surround-test.el15
1 files changed, 15 insertions, 0 deletions
diff --git a/test/evil-surround-test.el b/test/evil-surround-test.el
index 0ab98de..763aa44 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))))))))