Files
vim-vue-plugin/test/cases/oneline.vim
T
leafOfTree de812d609b Add tests and GitHub Actions
Replace the Travis tests, which used a separate repo and no longer
ran, with tests in this repo. Each case in test/cases is indented as
a whole and should be unchanged, with optional syntax, fold and tag
checks. The cases are from the previous tests, plus script-setup.vue
for <script setup> keywords and a sync check in oneline.vim.

test/run.sh runs the cases with Vim in a pseudo terminal, as syntax in
Ex mode isn't the same, and Neovim headless.
2026-10-19 14:20:24 +00:00

23 lines
736 B
VimL

" One-line blocks like <style>p { color: red; }</style>
function! Check()
call ExpectSyntax('script', 'javascriptScriptBlock')
call ExpectSyntax('p {', 'cssStyleBlock')
call ExpectSyntax('color', 'cssTextProp')
call ExpectSyntax('p {', 'cssStyleBlock')
call ExpectSyntax('color', 'cssTextProp')
call ExpectSyntax('Hello', 'htmlTemplateBlock')
call CheckSync()
endfunction
" Syntax from a sync point, as after jumping to a line not displayed yet
function! CheckSync()
silent edit!
call cursor(line('$'), 1)
call search('Hello', 'cW')
if index(SyntaxList(), 'htmlTemplateBlock') == -1
call Fail('after syncing, Hello should be htmlTemplateBlock, but got '
\.string(SyntaxList()))
endif
endfunction