mirror of
https://github.com/sheerun/vim-polyglot.git
synced 2025-11-14 22:43:49 -05:00
Update test script to ruby
This commit is contained in:
@@ -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"
|
||||
|
||||
@@ -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
10
tests/indent/2.1/test.js
Normal 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
10
tests/indent/4.1/test.js
Normal file
@@ -0,0 +1,10 @@
|
||||
// File with 4-spaces indentation
|
||||
function foobar() {
|
||||
foo = bar
|
||||
while (true) {
|
||||
fizfuz()
|
||||
fizfuz()
|
||||
fizfuz()
|
||||
fizfuz()
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user