aboutsummaryrefslogtreecommitdiffstats
path: root/src/test.el
diff options
context:
space:
mode:
authorWilliam David Mayo ("Dave") <pobocks@gmail.com>2014-08-28 09:28:08 -0400
committerWilliam David Mayo ("Dave") <pobocks@gmail.com>2014-08-28 09:28:08 -0400
commitbd79daecfd6e59deb67c771c6de85817fd478b43 (patch)
treed86a0a007f1cea0c3571e4fa86f272aa21ed05b3 /src/test.el
parent288fbf15b73b391e339e45573739688c3be8b7ae (diff)
parente0e0a29bcf13f29c004de6c54ea2879738cc2ecb (diff)
downloademmet-mode-bd79daecfd6e59deb67c771c6de85817fd478b43.tar.lz
emmet-mode-bd79daecfd6e59deb67c771c6de85817fd478b43.tar.xz
emmet-mode-bd79daecfd6e59deb67c771c6de85817fd478b43.zip
Merge pull request #46 from pobocks/wrap_with_markup
Wrap with markup
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)