mirror of
https://github.com/mattn/emmet-vim.git
synced 2026-03-25 05:48:06 +08:00
Skip visual/input tests in ex mode for CI compatibility
Tests requiring visual mode or input() cannot run in -e -s mode. Skip them gracefully instead of failing.
This commit is contained in:
@@ -264,12 +264,18 @@ Describe html
|
||||
Assert Equals(res, 'foo <span></span> bar')
|
||||
End
|
||||
|
||||
It wraps visual word
|
||||
It wraps visual word (skip: ex mode)
|
||||
if mode() ==# 'c'
|
||||
Skip not supported in ex mode
|
||||
endif
|
||||
let res = ExpandInBuffer("foo $$$$\\<c-o>ve\\<c-y>,p\\<cr>$$$$bar baz", 'html', 'foo <p>bar</p> baz')
|
||||
Assert Equals(res, 'foo <p>bar</p> baz')
|
||||
End
|
||||
|
||||
It wraps visual multi word
|
||||
It wraps visual multi word (skip: ex mode)
|
||||
if mode() ==# 'c'
|
||||
Skip not supported in ex mode
|
||||
endif
|
||||
let res = ExpandInBuffer("foo $$$$\\<c-o>vee\\<c-y>,p\\<cr>$$$$bar baz", 'html', 'foo <p>bar baz</p>')
|
||||
Assert Equals(res, 'foo <p>bar baz</p>')
|
||||
End
|
||||
@@ -287,17 +293,26 @@ Describe html
|
||||
Assert Equals(ExpandWord('(div>(label+input))+div', 'html'), "<div>\n\t<label for=\"\"></label>\n\t<input type=\"\">\n</div>\n<div></div>\n")
|
||||
End
|
||||
|
||||
It wraps visual lines with multiplier
|
||||
It wraps visual lines with multiplier (skip: ex mode)
|
||||
if mode() ==# 'c'
|
||||
Skip not supported in ex mode
|
||||
endif
|
||||
let res = ExpandInBuffer("test1\ntest2\ntest3$$$$\\<esc>ggVG\\<c-y>,ul>li>span*>a\\<cr>$$$$", 'html', "<ul>\n\t<li>\n\t\t<span><a href=\"\">test1</a></span>\n\t\t<span><a href=\"\">test2</a></span>\n\t\t<span><a href=\"\">test3</a></span>\n\t</li>\n</ul>")
|
||||
Assert Equals(res, "<ul>\n\t<li>\n\t\t<span><a href=\"\">test1</a></span>\n\t\t<span><a href=\"\">test2</a></span>\n\t\t<span><a href=\"\">test3</a></span>\n\t</li>\n</ul>")
|
||||
End
|
||||
|
||||
It wraps visual lines with input
|
||||
It wraps visual lines with input (skip: ex mode)
|
||||
if mode() ==# 'c'
|
||||
Skip not supported in ex mode
|
||||
endif
|
||||
let res = ExpandInBuffer("test1\ntest2\ntest3$$$$\\<esc>ggVG\\<c-y>,input[type=input value=$#]*\\<cr>$$$$", 'html', "<input type=\"input\" value=\"test1\">\n<input type=\"input\" value=\"test2\">\n<input type=\"input\" value=\"test3\">")
|
||||
Assert Equals(res, "<input type=\"input\" value=\"test1\">\n<input type=\"input\" value=\"test2\">\n<input type=\"input\" value=\"test3\">")
|
||||
End
|
||||
|
||||
It wraps visual lines with div id
|
||||
It wraps visual lines with div id (skip: ex mode)
|
||||
if mode() ==# 'c'
|
||||
Skip not supported in ex mode
|
||||
endif
|
||||
let res = ExpandInBuffer("test1\ntest2\ntest3$$$$\\<esc>ggVG\\<c-y>,div[id=$#]*\\<cr>$$$$", 'html', "<div id=\"test1\"></div>\n<div id=\"test2\"></div>\n<div id=\"test3\"></div>")
|
||||
Assert Equals(res, "<div id=\"test1\"></div>\n<div id=\"test2\"></div>\n<div id=\"test3\"></div>")
|
||||
End
|
||||
@@ -334,7 +349,10 @@ Describe html
|
||||
Assert Equals(ExpandWord('span.item$*2>{item $}', 'html'), "<span class=\"item1\">item 1</span>\n<span class=\"item2\">item 2</span>\n")
|
||||
End
|
||||
|
||||
It wraps visual indented block
|
||||
It wraps visual indented block (skip: ex mode)
|
||||
if mode() ==# 'c'
|
||||
Skip not supported in ex mode
|
||||
endif
|
||||
let res = ExpandInBuffer("\t<div class=\"footer_nav\">\n\t\t<a href=\"#\">nav link</a>\n\t</div>$$$$\\<esc>ggVG\\<c-y>,div\\<cr>$$$$", 'html', "\t<div>\n\t\t<div class=\"footer_nav\">\n\t\t\t<a href=\"#\">nav link</a>\n\t\t</div>\n\t</div>")
|
||||
Assert Equals(res, "\t<div>\n\t\t<div class=\"footer_nav\">\n\t\t\t<a href=\"#\">nav link</a>\n\t\t</div>\n\t</div>")
|
||||
End
|
||||
@@ -444,12 +462,18 @@ Describe html
|
||||
End
|
||||
|
||||
Describe update tag
|
||||
It adds class
|
||||
It adds class (skip: ex mode)
|
||||
if mode() ==# 'c'
|
||||
Skip not supported in ex mode
|
||||
endif
|
||||
let res = ExpandInBuffer("<h$$$$\\<c-y>u.global\\<cr>$$$$3></h3>", 'html', '<h3 class="global"></h3>')
|
||||
Assert Equals(res, '<h3 class="global"></h3>')
|
||||
End
|
||||
|
||||
It adds class preserving attribute
|
||||
It adds class preserving attribute (skip: ex mode)
|
||||
if mode() ==# 'c'
|
||||
Skip not supported in ex mode
|
||||
endif
|
||||
let res = ExpandInBuffer("<button$$$$\\<c-y>u.btn\\<cr>$$$$ disabled></button>", 'html', '<button class="btn" disabled></button>')
|
||||
Assert Equals(res, '<button class="btn" disabled></button>')
|
||||
End
|
||||
|
||||
Reference in New Issue
Block a user