diff options
Diffstat (limited to 'src/testdir/test_codestyle.vim')
-rw-r--r-- | src/testdir/test_codestyle.vim | 37 |
1 files changed, 37 insertions, 0 deletions
diff --git a/src/testdir/test_codestyle.vim b/src/testdir/test_codestyle.vim index beb4a6818d..c643ff2e84 100644 --- a/src/testdir/test_codestyle.vim +++ b/src/testdir/test_codestyle.vim @@ -41,5 +41,42 @@ def Test_source_files() bwipe! enddef +def Test_test_files() + for fname in glob('*.vim', 0, 1) + exe 'edit ' .. fname + + # some files intentionally have misplaced white space + if fname =~ 'test_cindent.vim' || fname =~ 'test_join.vim' + continue + endif + + # skip files that are known to have a space before a tab + if fname !~ 'test_comments.vim' + && fname !~ 'test_listchars.vim' + && fname !~ 'test_visual.vim' + cursor(1, 1) + var lnum = search(fname =~ "test_regexp_latin" ? '[^รก] \t' : ' \t') + assert_equal(0, lnum, 'testdir/' .. fname .. ': space before tab') + endif + + # skip files that are known to have trailing white space + if fname !~ 'test_cmdline.vim' + && fname !~ 'test_let.vim' + && fname !~ 'test_tagjump.vim' + && fname !~ 'test_vim9_cmd.vim' + cursor(1, 1) + var lnum = search( + fname =~ 'test_vim9_assign.vim' ? '[^=]\s$' + : fname =~ 'test_vim9_class.vim' ? '[^)]\s$' + : fname =~ 'test_vim9_script.vim' ? '[^,:3]\s$' + : fname =~ 'test_visual.vim' ? '[^/]\s$' + : '[^\\]\s$') + assert_equal(0, lnum, 'testdir/' .. fname .. ': trailing white space') + endif + endfor + + bwipe! +enddef + " vim: shiftwidth=2 sts=2 expandtab |