aboutsummaryrefslogtreecommitdiffstats
path: root/src/test.el
diff options
context:
space:
mode:
authorflyingleafe <flyingleafe@gmail.com>2014-09-03 14:06:02 +0400
committerflyingleafe <flyingleafe@gmail.com>2014-09-03 14:06:02 +0400
commitc76f9e62501c240ed8bb9af46f59d2ce4b975b89 (patch)
treed86a0a007f1cea0c3571e4fa86f272aa21ed05b3 /src/test.el
parent390f245bacabb169691bf2ce544ee5384d1112d7 (diff)
parentbd79daecfd6e59deb67c771c6de85817fd478b43 (diff)
downloademmet-mode-c76f9e62501c240ed8bb9af46f59d2ce4b975b89.tar.lz
emmet-mode-c76f9e62501c240ed8bb9af46f59d2ce4b975b89.tar.xz
emmet-mode-c76f9e62501c240ed8bb9af46f59d2ce4b975b89.zip
Merge branch 'master' of github.com:smihica/emmet-mode
Diffstat (limited to 'src/test.el')
-rw-r--r--src/test.el26
1 files changed, 26 insertions, 0 deletions
diff --git a/src/test.el b/src/test.el
index 69c5a3c..28b7db4 100644
--- a/src/test.el
+++ b/src/test.el
@@ -622,5 +622,31 @@
;; Old tests for previous indent behavior last seen:
;; commit: f56174e5905a40583b47f9737abee3af8da3faeb
+(defun emmet-wrap-with-markup-test (lis)
+ (let ((es (car lis))
+ (ins (or (elt lis 1) "This is gnarly text with $$$s and <span>markup</span> and end brackets}}s"))
+ (indent-tabs-mode nil)
+ (tab-width 2)
+ (standard-indent 2))
+ (with-temp-buffer
+ (emmet-mode 1)
+ (sgml-mode)
+ (set-mark (point))
+ (insert ins)
+ (emmet-wrap-with-markup es)
+ (buffer-string))))
+
+(emmet-run-test-case "Wrap with markup on text with brackets and markup"
+ #'emmet-wrap-with-markup-test
+ '((("div>ul>li") . "<div>\n <ul>\n <li>This is gnarly text with $$$s and <span>markup</span> and end brackets}}s</li>\n </ul>\n</div>")))
+
+(emmet-run-test-case "Wrap with markup multiplier"
+ #'emmet-wrap-with-markup-test
+ '((("div>ul>li*3") . "<div>\n <ul>\n <li>This is gnarly text with $$$s and <span>markup</span> and end brackets}}s</li>\n <li>This is gnarly text with $$$s and <span>markup</span> and end brackets}}s</li>\n <li>This is gnarly text with $$$s and <span>markup</span> and end brackets}}s</li>\n </ul>\n</div>")))
+
+(emmet-run-test-case "Wrap with multiline content"
+ #'emmet-wrap-with-markup-test
+ '((("div>ul>li" "I am some\nmultiline\n text") . "<div>\n <ul>\n <li>I am some\n multiline\n text</li>\n </ul>\n</div>")))
+
;; start
(emmet-test-cases)