From dd4aecb453b2f9ad494c9e0ca397528db2bbf2ac Mon Sep 17 00:00:00 2001 From: Dave Mayo Date: Mon, 25 Aug 2014 08:25:32 -0400 Subject: Tests for escape and multiplier. --- src/test.el | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) (limited to 'src/test.el') diff --git a/src/test.el b/src/test.el index 69c5a3c..48bb5ed 100644 --- a/src/test.el +++ b/src/test.el @@ -622,5 +622,26 @@ ;; Old tests for previous indent behavior last seen: ;; commit: f56174e5905a40583b47f9737abee3af8da3faeb +(defun emmet-wrap-with-markup-test (lis) + (let ((es (car lis)) + (indent-tabs-mode nil) + (tab-width 2) + (standard-indent 2)) + (with-temp-buffer + (emmet-mode 1) + (sgml-mode) + (set-mark (point)) + (insert "This is gnarly text with $$$s and markup and end brackets}}s") + (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") . "
\n \n
"))) + +(emmet-run-test-case "Wrap with markup multiplier" + #'emmet-wrap-with-markup-test + '((("div>ul>li*3") . "
\n \n
"))) + ;; start (emmet-test-cases) -- cgit v1.2.3 From e0e0a29bcf13f29c004de6c54ea2879738cc2ecb Mon Sep 17 00:00:00 2001 From: Dave Mayo Date: Thu, 28 Aug 2014 08:03:03 -0400 Subject: Wrap using token replacement, handles multiline. Test for multiline. --- src/test.el | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'src/test.el') diff --git a/src/test.el b/src/test.el index 48bb5ed..28b7db4 100644 --- a/src/test.el +++ b/src/test.el @@ -624,6 +624,7 @@ (defun emmet-wrap-with-markup-test (lis) (let ((es (car lis)) + (ins (or (elt lis 1) "This is gnarly text with $$$s and markup and end brackets}}s")) (indent-tabs-mode nil) (tab-width 2) (standard-indent 2)) @@ -631,7 +632,7 @@ (emmet-mode 1) (sgml-mode) (set-mark (point)) - (insert "This is gnarly text with $$$s and markup and end brackets}}s") + (insert ins) (emmet-wrap-with-markup es) (buffer-string)))) @@ -643,5 +644,9 @@ #'emmet-wrap-with-markup-test '((("div>ul>li*3") . "
\n
    \n
  • This is gnarly text with $$$s and markup and end brackets}}s
  • \n
  • This is gnarly text with $$$s and markup and end brackets}}s
  • \n
  • This is gnarly text with $$$s and markup and end brackets}}s
  • \n
\n
"))) +(emmet-run-test-case "Wrap with multiline content" + #'emmet-wrap-with-markup-test + '((("div>ul>li" "I am some\nmultiline\n text") . "
\n
    \n
  • I am some\n multiline\n text
  • \n
\n
"))) + ;; start (emmet-test-cases) -- cgit v1.2.3