]> granicus.if.org Git - vim/commitdiff
patch 7.4.1569 v7.4.1569
authorBram Moolenaar <Bram@vim.org>
Tue, 15 Mar 2016 13:11:10 +0000 (14:11 +0100)
committerBram Moolenaar <Bram@vim.org>
Tue, 15 Mar 2016 13:11:10 +0000 (14:11 +0100)
Problem:    Using old style tests for quickfix.
Solution:   Change them to new style tests. (Yegappan Lakshmanan)

src/testdir/Make_all.mak
src/testdir/test106.in [deleted file]
src/testdir/test106.ok [deleted file]
src/testdir/test_qf_title.in [deleted file]
src/testdir/test_qf_title.ok [deleted file]
src/testdir/test_quickfix.vim
src/version.c

index 233ca12dfdb9299ca32576934c50a054b68dc39c..1885bd7ed20178722bf179b3480ad3957837a9d0 100644 (file)
@@ -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 (file)
index eb99e65..0000000
+++ /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 (file)
index 0a18cec..0000000
+++ /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 (file)
index fce0c26..0000000
+++ /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 (file)
index 4ebdbef..0000000
+++ /dev/null
@@ -1,2 +0,0 @@
-Results of test_qf_title:
-:setqflist()
index 5e684502395ae16895b2e9629552e11f39e988cf..4be37d5860a33019084bb7e8b7cd9a8ab7fb26e9 100644 (file)
@@ -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
index bfb196870af709e7510011ec226af2e46041b617..5695515f55d85400da9b510e588097861377aa93 100644 (file)
@@ -743,6 +743,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    1569,
 /**/
     1568,
 /**/