aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/nvim/testdir/test_quickfix.vim37
1 files changed, 35 insertions, 2 deletions
diff --git a/src/nvim/testdir/test_quickfix.vim b/src/nvim/testdir/test_quickfix.vim
index 676d14387e..8b078281e8 100644
--- a/src/nvim/testdir/test_quickfix.vim
+++ b/src/nvim/testdir/test_quickfix.vim
@@ -366,6 +366,13 @@ func XfileTests(cchar)
\ 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
@@ -1123,6 +1130,10 @@ func Xinvalid_efm_Tests(cchar)
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:')
@@ -1153,6 +1164,11 @@ func Test_efm2()
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]
@@ -1190,6 +1206,14 @@ func Test_efm2()
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
@@ -1231,18 +1255,19 @@ func Test_efm2()
File "/usr/lib/python2.2/unittest.py", line 286, in
failUnlessEqual
raise self.failureException, \\
- AssertionError: 34 != 33
+ W:AssertionError: 34 != 33
--------------------------------------------------------------
Ran 27 tests in 0.063s
[DATA]
- set efm=%C\ %.%#,%A\ \ File\ \"%f\"\\,\ line\ %l%.%#,%Z%[%^\ ]%\\@=%m
+ 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(expand('unittests/dbfacadeTest.py'), bufname(l[4].bufnr))
+ call assert_equal('W', l[4].type)
" Test for %o
set efm=%f(%o):%l\ %m
@@ -1259,6 +1284,14 @@ func Test_efm2()
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(repeat('m', 1023), 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']