diff options
author | Adam Stankiewicz <sheerun@sher.pl> | 2020-10-07 21:51:30 +0200 |
---|---|---|
committer | Adam Stankiewicz <sheerun@sher.pl> | 2020-10-07 21:51:30 +0200 |
commit | 4bec20ec1a7cde0c29d9550d244f428484fa56ab (patch) | |
tree | 9d0e03e25083e1e9f313150ccdf435a15bcab789 /scripts | |
parent | 9f4e2b683453c9521de8164169327a112d71f6c1 (diff) | |
download | vim-polyglot-4.13.2.tar.gz vim-polyglot-4.13.2.zip |
Fix test and loading of filetypes, closes #577v4.13.2
Diffstat (limited to 'scripts')
-rwxr-xr-x | scripts/build | 18 | ||||
-rwxr-xr-x | scripts/test | 6 |
2 files changed, 11 insertions, 13 deletions
diff --git a/scripts/build b/scripts/build index c5141d41..8f46b217 100755 --- a/scripts/build +++ b/scripts/build @@ -177,7 +177,8 @@ def patterns_to_vim_patterns(patterns) stdin.write(patterns.join("\n")) stdin.close stdout.readlines.map(&:chomp).map do |r| - r.gsub('\b', '\(\<\|\>\)') + r.gsub!('\b', '\(\<\|\>\)') + r end end @@ -274,7 +275,10 @@ def copy_file(package, src, dest) output << "if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, '#{name}') == -1\n\n" end contents = File.read(input) + # ..= is feature of new vims... contents.gsub!(' ..= ', ' .= ') + # https://github.com/vim/vim/pull/7091 + contents.gsub!('fileencoding=', 'encoding=') output << contents output << "\nendif\n" end @@ -649,15 +653,7 @@ def inject_code(path, code) end def generate_tests(packages) - output = <<~EOS - function! TestFiletype(filetype) - call Log('Loading ' . a:filetype . ' filetype...') - - enew - exec 'set ft=' . a:filetype - endfunction - - EOS + output = "" for package in packages for filetype in package.fetch("filetypes", []) @@ -665,7 +661,7 @@ def generate_tests(packages) end end - File.write('tests/filetypes.vim', output) + inject_code('tests/filetypes.vim', output) end diff --git a/scripts/test b/scripts/test index ebb6d6ce..f22c224c 100755 --- a/scripts/test +++ b/scripts/test @@ -8,8 +8,10 @@ def run_vimscript(src) wrapper = <<~EOF vim --clean --not-a-term -u <(cat <<- "EOM" let g:polyglot_test = 1 + set nocompatible let &rtp='$PWD,' . &rtp - runtime filetype.vim + filetype plugin indent on + syntax on set t_ti= t_te= set shortmess+=F set noswapfile @@ -44,7 +46,7 @@ test_helptags = <<~EOF EOF run_vimscript('source tests/filetypes.vim') -run_vimscript('source tests/extensions.vim') +# run_vimscript('source tests/extensions.vim') run_script(test_helptags) # run_vimscript(" |