To: vim_dev@googlegroups.com Subject: Patch 8.1.2339 Fcc: outbox From: Bram Moolenaar Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ------------ Patch 8.1.2339 Problem: Insufficient testing for quickfix. Solution: Add a few more tests. (Yegappan Lakshmanan, closes #5261) Files: src/testdir/test_quickfix.vim *** ../vim-8.1.2338/src/testdir/test_quickfix.vim 2019-11-19 22:38:44.552605108 +0100 --- src/testdir/test_quickfix.vim 2019-11-24 12:02:09.771808206 +0100 *************** *** 363,368 **** --- 363,375 ---- \ l[0].lnum == 222 && l[0].col == 77 && l[0].text ==# 'Line 222' && \ l[1].lnum == 333 && l[1].col == 88 && l[1].text ==# 'Line 333') + " Test for a file with a long line and without a newline at the end + let text = repeat('x', 1024) + let t = 'a.txt:18:' . text + call writefile([t], 'Xqftestfile1', 'b') + silent! Xfile Xqftestfile1 + call assert_equal(text, g:Xgetlist()[0].text) + call delete('Xqftestfile1') endfunc *************** *** 619,633 **** let w3 = win_getid() call assert_true(&buftype == 'help') call assert_true(winnr() == 1) ! " See jump_to_help_window() for details ! let w2_width = winwidth(w2) ! if w2_width != &columns && w2_width < 80 ! call assert_equal(['col', [['leaf', w3], ! \ ['row', [['leaf', w2], ['leaf', w1]]]]], winlayout()) ! else ! call assert_equal(['row', [['col', [['leaf', w3], ['leaf', w2]]], ! \ ['leaf', w1]]] , winlayout()) ! endif new | only set buftype=help --- 626,635 ---- let w3 = win_getid() call assert_true(&buftype == 'help') call assert_true(winnr() == 1) ! call win_gotoid(w1) ! call assert_equal(w3, win_getid(winnr('k'))) ! call win_gotoid(w2) ! call assert_equal(w3, win_getid(winnr('k'))) new | only set buftype=help *************** *** 1133,1138 **** --- 1135,1144 ---- set efm=%f:%l:%m,%f:%l:%m:%R call assert_fails('Xexpr "abc.txt:1:Hello world"', 'E377:') + " Invalid regular expression + set efm=%\\%%k + call assert_fails('Xexpr "abc.txt:1:Hello world"', 'E867:') + set efm= call assert_fails('Xexpr "abc.txt:1:Hello world"', 'E378:') *************** *** 1157,1168 **** set efm=%f:%s cexpr 'Xtestfile:Line search text' let l = getqflist() ! call assert_equal(l[0].pattern, '^\VLine search text\$') ! call assert_equal(l[0].lnum, 0) let l = split(execute('clist', ''), "\n") call assert_equal([' 1 Xtestfile:^\VLine search text\$: '], l) " Test for %P, %Q and %t format specifiers let lines =<< trim [DATA] [Xtestfile1] --- 1163,1179 ---- set efm=%f:%s cexpr 'Xtestfile:Line search text' let l = getqflist() ! call assert_equal('^\VLine search text\$', l[0].pattern) ! call assert_equal(0, l[0].lnum) let l = split(execute('clist', ''), "\n") call assert_equal([' 1 Xtestfile:^\VLine search text\$: '], l) + " Test for a long line + cexpr 'Xtestfile:' . repeat('a', 1026) + let l = getqflist() + call assert_equal('^\V' . repeat('a', 1019) . '\$', l[0].pattern) + " Test for %P, %Q and %t format specifiers let lines =<< trim [DATA] [Xtestfile1] *************** *** 1201,1206 **** --- 1212,1225 ---- call delete('Xtestfile2') call delete('Xtestfile3') + " Test for %P, %Q with non-existing files + cexpr lines + let l = getqflist() + call assert_equal(14, len(l)) + call assert_equal('[Xtestfile1]', l[0].text) + call assert_equal('[Xtestfile2]', l[6].text) + call assert_equal('[Xtestfile3]', l[9].text) + " Tests for %E, %C and %Z format specifiers let lines =<< trim [DATA] Error 275 *************** *** 1242,1260 **** File "/usr/lib/python2.2/unittest.py", line 286, in failUnlessEqual raise self.failureException, \\ ! AssertionError: 34 != 33 -------------------------------------------------------------- Ran 27 tests in 0.063s [DATA] ! set efm=%C\ %.%#,%A\ \ File\ \"%f\"\\,\ line\ %l%.%#,%Z%[%^\ ]%\\@=%m cgetexpr lines let l = getqflist() call assert_equal(8, len(l)) call assert_equal(89, l[4].lnum) call assert_equal(1, l[4].valid) call assert_equal('unittests/dbfacadeTest.py', bufname(l[4].bufnr)) " Test for %o set efm=%f(%o):%l\ %m --- 1261,1280 ---- File "/usr/lib/python2.2/unittest.py", line 286, in failUnlessEqual raise self.failureException, \\ ! W:AssertionError: 34 != 33 -------------------------------------------------------------- Ran 27 tests in 0.063s [DATA] ! set efm=%C\ %.%#,%A\ \ File\ \"%f\"\\,\ line\ %l%.%#,%Z%[%^\ ]%\\@=%t:%m cgetexpr lines let l = getqflist() call assert_equal(8, len(l)) call assert_equal(89, l[4].lnum) call assert_equal(1, l[4].valid) call assert_equal('unittests/dbfacadeTest.py', bufname(l[4].bufnr)) + call assert_equal('W', l[4].type) " Test for %o set efm=%f(%o):%l\ %m *************** *** 1271,1276 **** --- 1291,1303 ---- bd call delete("Xotestfile") + " Test for a long module name + cexpr 'Xtest(' . repeat('m', 1026) . '):15 message' + let l = getqflist() + call assert_equal(repeat('m', 1024), l[0].module) + call assert_equal(15, l[0].lnum) + call assert_equal('message', l[0].text) + " The following sequence of commands used to crash Vim set efm=%W%m cgetexpr ['msg1'] *** ../vim-8.1.2338/src/version.c 2019-11-23 21:55:52.758656249 +0100 --- src/version.c 2019-11-24 12:03:16.543468588 +0100 *************** *** 739,740 **** --- 739,742 ---- { /* Add new patch number below this line */ + /**/ + 2339, /**/ -- hundred-and-one symptoms of being an internet addict: 115. You are late picking up your kid from school and try to explain to the teacher you were stuck in Web traffic. /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net \\\ /// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\ \\\ an exciting new programming language -- http://www.Zimbu.org /// \\\ help me help AIDS victims -- http://ICCF-Holland.org ///