diff options
author | Bram Moolenaar <Bram@vim.org> | 2016-03-15 14:11:10 +0100 |
---|---|---|
committer | Bram Moolenaar <Bram@vim.org> | 2016-03-15 14:11:10 +0100 |
commit | e27dba499aaaf2ffe9f0da45f062450b434cddaa (patch) | |
tree | e7c05804b970cebd74f5c980e919adb95144b5dd /src/testdir | |
parent | 00f9e0dbbd3472db217d56639fad9346b9eb3b82 (diff) | |
download | vim-git-e27dba499aaaf2ffe9f0da45f062450b434cddaa.tar.gz |
patch 7.4.1569v7.4.1569
Problem: Using old style tests for quickfix.
Solution: Change them to new style tests. (Yegappan Lakshmanan)
Diffstat (limited to 'src/testdir')
-rw-r--r-- | src/testdir/Make_all.mak | 2 | ||||
-rw-r--r-- | src/testdir/test106.in | 16 | ||||
-rw-r--r-- | src/testdir/test106.ok | 4 | ||||
-rw-r--r-- | src/testdir/test_qf_title.in | 18 | ||||
-rw-r--r-- | src/testdir/test_qf_title.ok | 2 | ||||
-rw-r--r-- | src/testdir/test_quickfix.vim | 50 |
6 files changed, 50 insertions, 42 deletions
diff --git a/src/testdir/Make_all.mak b/src/testdir/Make_all.mak index 233ca12df..1885bd7ed 100644 --- a/src/testdir/Make_all.mak +++ b/src/testdir/Make_all.mak @@ -87,7 +87,6 @@ SCRIPTS_ALL = \ test103.out \ test104.out \ test105.out \ - test106.out \ test107.out \ test108.out \ test_autocmd_option.out \ @@ -110,7 +109,6 @@ SCRIPTS_ALL = \ test_match_conceal.out \ test_nested_function.out \ test_options.out \ - test_qf_title.out \ test_ruby.out \ test_search_mbyte.out \ test_signs.out \ diff --git a/src/testdir/test106.in b/src/testdir/test106.in deleted file mode 100644 index eb99e650a..000000000 --- a/src/testdir/test106.in +++ /dev/null @@ -1,16 +0,0 @@ -Tests for errorformat. vim: set ft=vim ts=8 : - -STARTTEST -:so small.vim -:if !has('quickfix') | e! test.ok | wq! test.out | endif -:set efm=%EEEE%m,%WWWW%m,%+CCCC%.%#,%-GGGG%.%# -:cgetexpr ['WWWW', 'EEEE', 'CCCC'] -:$put =strtrans(string(map(getqflist(), '[v:val.text, v:val.valid]'))) -:cgetexpr ['WWWW', 'GGGG', 'EEEE', 'CCCC'] -:$put =strtrans(string(map(getqflist(), '[v:val.text, v:val.valid]'))) -:cgetexpr ['WWWW', 'GGGG', 'ZZZZ', 'EEEE', 'CCCC', 'YYYY'] -:$put =strtrans(string(map(getqflist(), '[v:val.text, v:val.valid]'))) -:/^Results/,$wq! test.out -ENDTEST - -Results of test106: diff --git a/src/testdir/test106.ok b/src/testdir/test106.ok deleted file mode 100644 index 0a18cecf1..000000000 --- a/src/testdir/test106.ok +++ /dev/null @@ -1,4 +0,0 @@ -Results of test106: -[['W', 1], ['E^@CCCC', 1]] -[['W', 1], ['E^@CCCC', 1]] -[['W', 1], ['ZZZZ', 0], ['E^@CCCC', 1], ['YYYY', 0]] diff --git a/src/testdir/test_qf_title.in b/src/testdir/test_qf_title.in deleted file mode 100644 index fce0c260e..000000000 --- a/src/testdir/test_qf_title.in +++ /dev/null @@ -1,18 +0,0 @@ -Tests for quickfix window's title vim: set ft=vim : - -STARTTEST -:so small.vim -:if !has('quickfix') | e! test.ok | wq! test.out | endif -:set efm=%E%f:%l:%c:%m -:cgetexpr ['file:1:1:message'] -:let qflist=getqflist() -:call setqflist(qflist, 'r') -:copen -:let g:quickfix_title=w:quickfix_title -:wincmd p -:$put =g:quickfix_title -:/^Results/,$w test.out -:qa! -ENDTEST - -Results of test_qf_title: diff --git a/src/testdir/test_qf_title.ok b/src/testdir/test_qf_title.ok deleted file mode 100644 index 4ebdbeff3..000000000 --- a/src/testdir/test_qf_title.ok +++ /dev/null @@ -1,2 +0,0 @@ -Results of test_qf_title: -:setqflist() diff --git a/src/testdir/test_quickfix.vim b/src/testdir/test_quickfix.vim index 5e6845023..4be37d586 100644 --- a/src/testdir/test_quickfix.vim +++ b/src/testdir/test_quickfix.vim @@ -316,3 +316,53 @@ func Test_errortitle() augroup END augroup! QfBufWinEnter endfunc + +function XqfTitleTests(cchar) + let Xgetexpr = a:cchar . 'getexpr' + if a:cchar == 'c' + let Xgetlist = 'getqflist()' + else + let Xgetlist = 'getloclist(0)' + endif + let Xopen = a:cchar . 'open' + let Xclose = a:cchar . 'close' + + exe Xgetexpr . " ['file:1:1:message']" + exe 'let l = ' . Xgetlist + if a:cchar == 'c' + call setqflist(l, 'r') + else + call setloclist(0, l, 'r') + endif + + exe Xopen + if a:cchar == 'c' + let title = ':setqflist()' + else + let title = ':setloclist()' + endif + call assert_equal(title, w:quickfix_title) + exe Xclose +endfunction + +" Tests for quickfix window's title +function Test_qf_title() + call XqfTitleTests('c') + call XqfTitleTests('l') +endfunction + +" Tests for 'errorformat' +function Test_efm() + let save_efm = &efm + set efm=%EEEE%m,%WWWW%m,%+CCCC%.%#,%-GGGG%.%# + cgetexpr ['WWWW', 'EEEE', 'CCCC'] + let l = strtrans(string(map(getqflist(), '[v:val.text, v:val.valid]'))) + call assert_equal("[['W', 1], ['E^@CCCC', 1]]", l) + cgetexpr ['WWWW', 'GGGG', 'EEEE', 'CCCC'] + let l = strtrans(string(map(getqflist(), '[v:val.text, v:val.valid]'))) + call assert_equal("[['W', 1], ['E^@CCCC', 1]]", l) + cgetexpr ['WWWW', 'GGGG', 'ZZZZ', 'EEEE', 'CCCC', 'YYYY'] + let l = strtrans(string(map(getqflist(), '[v:val.text, v:val.valid]'))) + call assert_equal("[['W', 1], ['ZZZZ', 0], ['E^@CCCC', 1], ['YYYY', 0]]", l) + let &efm = save_efm +endfunction |