Mercurial > vim
comparison src/testdir/test_quickfix.vim @ 8558:22aecf80378e v7.4.1569
commit https://github.com/vim/vim/commit/e27dba499aaaf2ffe9f0da45f062450b434cddaa
Author: Bram Moolenaar <Bram@vim.org>
Date: Tue Mar 15 14:11:10 2016 +0100
patch 7.4.1569
Problem: Using old style tests for quickfix.
Solution: Change them to new style tests. (Yegappan Lakshmanan)
author | Christian Brabandt <cb@256bit.org> |
---|---|
date | Tue, 15 Mar 2016 14:15:04 +0100 |
parents | bf58e9f8d52a |
children | 51de88bf954d |
comparison
equal
deleted
inserted
replaced
8557:843063722880 | 8558:22aecf80378e |
---|---|
314 augroup QfBufWinEnter | 314 augroup QfBufWinEnter |
315 au! | 315 au! |
316 augroup END | 316 augroup END |
317 augroup! QfBufWinEnter | 317 augroup! QfBufWinEnter |
318 endfunc | 318 endfunc |
319 | |
320 function XqfTitleTests(cchar) | |
321 let Xgetexpr = a:cchar . 'getexpr' | |
322 if a:cchar == 'c' | |
323 let Xgetlist = 'getqflist()' | |
324 else | |
325 let Xgetlist = 'getloclist(0)' | |
326 endif | |
327 let Xopen = a:cchar . 'open' | |
328 let Xclose = a:cchar . 'close' | |
329 | |
330 exe Xgetexpr . " ['file:1:1:message']" | |
331 exe 'let l = ' . Xgetlist | |
332 if a:cchar == 'c' | |
333 call setqflist(l, 'r') | |
334 else | |
335 call setloclist(0, l, 'r') | |
336 endif | |
337 | |
338 exe Xopen | |
339 if a:cchar == 'c' | |
340 let title = ':setqflist()' | |
341 else | |
342 let title = ':setloclist()' | |
343 endif | |
344 call assert_equal(title, w:quickfix_title) | |
345 exe Xclose | |
346 endfunction | |
347 | |
348 " Tests for quickfix window's title | |
349 function Test_qf_title() | |
350 call XqfTitleTests('c') | |
351 call XqfTitleTests('l') | |
352 endfunction | |
353 | |
354 " Tests for 'errorformat' | |
355 function Test_efm() | |
356 let save_efm = &efm | |
357 set efm=%EEEE%m,%WWWW%m,%+CCCC%.%#,%-GGGG%.%# | |
358 cgetexpr ['WWWW', 'EEEE', 'CCCC'] | |
359 let l = strtrans(string(map(getqflist(), '[v:val.text, v:val.valid]'))) | |
360 call assert_equal("[['W', 1], ['E^@CCCC', 1]]", l) | |
361 cgetexpr ['WWWW', 'GGGG', 'EEEE', 'CCCC'] | |
362 let l = strtrans(string(map(getqflist(), '[v:val.text, v:val.valid]'))) | |
363 call assert_equal("[['W', 1], ['E^@CCCC', 1]]", l) | |
364 cgetexpr ['WWWW', 'GGGG', 'ZZZZ', 'EEEE', 'CCCC', 'YYYY'] | |
365 let l = strtrans(string(map(getqflist(), '[v:val.text, v:val.valid]'))) | |
366 call assert_equal("[['W', 1], ['ZZZZ', 0], ['E^@CCCC', 1], ['YYYY', 0]]", l) | |
367 let &efm = save_efm | |
368 endfunction |