Add shared test cases with vim-svelte-plugin

Name cases for scenarios also in vim-svelte-plugin as shared-*, adding
one for multiline tags. test/shared.sh lists shared cases in only one
of the plugins, as a warning in a separate job on GitHub Actions.
This commit is contained in:
leafOfTree committed 2026-10-21 14:03:35 +00:00
1 parent ed9e40037f
commit faf8f75a4f
18 files changed
+67

No files matched your search

File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
+6
View File
@@ -0,0 +1,6 @@
" Lines after a multiline start tag or empty tag ending with '>' or '/>'
let g:test_flatten = 1
function! Check()
call ExpectIndentEachLine()
endfunction
+20
View File
@@ -0,0 +1,20 @@
<template>
<div
class="a"
id="b"
>
text
<input
type="text"
:value="name"
>
<img
src="a.png"
alt="a"
/>
<input type="checkbox"
checked
>
<p>end</p>
</div>
</template>
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Executable
+30
View File
@@ -0,0 +1,30 @@
#!/bin/sh
# List shared-* test cases missing in either vim-svelte-plugin or
# vim-vue-plugin. Both plugins work in the same way for blocks, so a case for
# a scenario in one plugin should be in the other with the same name. Only
# warn, as the other plugin may be updated later
# ./test/shared.sh
cd "$(dirname "$0")/.." || exit 1
other=vim-svelte-plugin
dir=test/other/$other
rm -rf "$dir"
git clone -q --depth 1 "https://github.com/leafOfTree/$other" "$dir" || exit 0
list() {
ls "$1"/test/cases/shared-*.vim 2>/dev/null | sed 's#.*/##; s#\.vim$##' | sort
}
list . > test/other/mine
list "$dir" > test/other/theirs
missing=0
for name in $(comm -23 test/other/mine test/other/theirs); do
echo "::warning::$name is not in $other"
missing=1
done
for name in $(comm -13 test/other/mine test/other/theirs); do
echo "::warning::$name in $other is not here"
missing=1
done
[ $missing -eq 0 ] && echo "Shared cases are the same as $other"
exit 0