summaryrefslogtreecommitdiff
path: root/test/evil-surround-test.el
diff options
context:
space:
mode:
Diffstat (limited to 'test/evil-surround-test.el')
-rw-r--r--test/evil-surround-test.el60
1 files changed, 59 insertions, 1 deletions
diff --git a/test/evil-surround-test.el b/test/evil-surround-test.el
index 240ec7a..b0c363f 100644
--- a/test/evil-surround-test.el
+++ b/test/evil-surround-test.el
@@ -38,4 +38,62 @@
("lds{ds)") ;; 'l' to move the cursor right, inside brackets
"Hello world!"
("ysiw<em>")
- "<em>Hello</em> world!")))
+ "<em>Hello</em> world!"))
+ (ert-info ("repeat surrounding")
+ (evil-test-buffer
+ "[o]ne two three"
+ (turn-on-evil-surround-mode)
+ ;; surround and repeat it
+ ("ysiwb")
+ "(one) two three"
+ ("W.") ;; repeat surround region
+ "(one) (two) three"
+ ("W.") ;; repeat surround region
+ "(one) (two) (three)"
+
+ ;; change surround and repeat it
+ ("0csb'")
+ "'one' (two) (three)"
+ ("W.") ;; repeat change surround
+ "'one' 'two' (three)"
+ ("W.") ;; repeat change surround
+ "'one' 'two' 'three'"
+
+ ;; delete surround and repeat it
+ ("0ds'")
+ "one 'two' 'three'"
+ ("W.") ;; repeat delete surround
+ "one two 'three'"
+ ("W.") ;; repeat delete surround
+ "one two three"))
+ (ert-info ("visual surrounding")
+ (evil-test-buffer
+ "<one two> three\nfour\n"
+ (turn-on-evil-surround-mode)
+ ("Sb")
+ "(one two) three\nfour\n")
+ (evil-test-buffer
+ "<one two three>\nfour\n"
+ (turn-on-evil-surround-mode)
+ ("Sb")
+ "(one two three)\nfour\n")
+ (evil-test-buffer
+ "<one two three\nfo>ur\n"
+ (turn-on-evil-surround-mode)
+ ("Sb")
+ "(one two three\nfo)ur\n"))
+ (ert-info ("visual line surrounding")
+ (evil-test-buffer
+ "[o]ne two three\nfour\n"
+ (turn-on-evil-surround-mode)
+ ("yssb")
+ "(one two three)\nfour\n"
+ ("dsb")
+ "one two three\nfour\n"
+ ("VSb")
+ "(\none two three\n)\nfour\n")
+ (evil-test-buffer
+ "111 222 333\n[1]11 222 333\n111 222 333\n111 222 333\n"
+ (turn-on-evil-surround-mode)
+ ("ysjb")
+ "111 222 333\n(\n111 222 333\n111 222 333\n)\n111 222 333\n")))