Hi,

The attached patch converts two old style quickfix related tests
to new style tests.

- Yegappan

-- 
-- 
You received this message from the "vim_dev" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

--- 
You received this message because you are subscribed to the Google Groups 
"vim_dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/d/optout.
diff --git a/src/testdir/Make_all.mak b/src/testdir/Make_all.mak
index 233ca12..1885bd7 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 eb99e65..0000000
--- 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 0a18cec..0000000
--- 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 fce0c26..0000000
--- 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 4ebdbef..0000000
--- 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 5e68450..4be37d5 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

Raspunde prin e-mail lui