Update test script to ruby

This commit is contained in:
Adam Stankiewicz
2020-09-23 19:37:50 +02:00
parent 92cb76e33a
commit 33f0964d53
9 changed files with 94 additions and 36 deletions

View File

@@ -1,8 +1,10 @@
function! TestExtension(filetype, filename, content)
call Log('Detecting ' . a:filetype . ' filetype (' . a:filename . ')...')
try
let g:message = ""
exec "noautocmd n " . a:filename
put =a:content
silent put =a:content
1delete _
filetype detect
exec "if &filetype != '" . a:filetype . "' \nthrow &filetype\nendif"

View File

@@ -1,13 +1,8 @@
function! TestFiletype(filetype)
try
enew
exec 'set ft=' . a:filetype
catch
echo 'Error loading filetype ' . a:filetype . ':'
echo v:exception
echo v:throwpoint
exec ':cq!'
endtry
call Log('Loading ' . a:filetype . ' filetype...')
enew
exec 'set ft=' . a:filetype
endfunction
call TestFiletype('8th')

10
tests/indent/2.1/test.js Normal file
View File

@@ -0,0 +1,10 @@
// File with 2-spaces indentation
function foobar() {
foo = bar
while (true) {
fizfuz()
fizfuz()
fizfuz()
fizfuz()
}
}

10
tests/indent/4.1/test.js Normal file
View File

@@ -0,0 +1,10 @@
// File with 4-spaces indentation
function foobar() {
foo = bar
while (true) {
fizfuz()
fizfuz()
fizfuz()
fizfuz()
}
}