comparison src/testdir/test_quickfix.vim @ 24976:fd205e78e163 v8.2.3025

patch 8.2.3025: not enough tests for quickfix end_col and end_lnum Commit: https://github.com/vim/vim/commit/0d5e1ec37fbe75e18acba6f650c59bf91063108c Author: shane.xb.qian <shane.qian@foxmail.com> Date: Sun Jun 20 16:31:00 2021 +0200 patch 8.2.3025: not enough tests for quickfix end_col and end_lnum Problem: Not enough tests for quickfix end_col and end_lnum. Solution: Add a few more test cases. (Shane-XB-Qian, closes https://github.com/vim/vim/issues/8409)
author Bram Moolenaar <Bram@vim.org>
date Sun, 20 Jun 2021 16:45:03 +0200
parents f4aa891a5ab8
children 5127844b909b
comparison
equal deleted inserted replaced
24975:acf2c62bee13 24976:fd205e78e163
5364 cexpr "Xfile1:10:aa" 5364 cexpr "Xfile1:10:aa"
5365 copen 5365 copen
5366 call setqflist(['bb'], 'a') 5366 call setqflist(['bb'], 'a')
5367 call assert_equal(1, line('$')) 5367 call assert_equal(1, line('$'))
5368 call assert_equal(['Xfile1|10| aa'], getline(1, '$')) 5368 call assert_equal(['Xfile1|10| aa'], getline(1, '$'))
5369 call assert_equal([{'lnum': 10, 'end_lnum': 0, 'bufnr': bufnr('Xfile1'), 'col': 0, 'end_col': 0, 'pattern': '', 'valid': 1, 'vcol': 0, 'nr': -1, 'type': '', 'module': '', 'text': 'aa'}], getqflist()) 5369 call assert_equal([{'lnum': 10 , 'end_lnum': 0 , 'bufnr': bufnr('Xfile1') , 'col': 0 , 'end_col': 0 , 'pattern': '' , 'valid': 1 , 'vcol': 0 , 'nr': -1 , 'type': '' , 'module': '' , 'text': 'aa'}] , getqflist())
5370
5371 call setqflist([{'lnum': 10 , 'bufnr': bufnr('Xfile1') , 'col': 0 , 'pattern': '' , 'valid': 1 , 'vcol': 0 , 'nr': -1 , 'type': '' , 'module': '' , 'text': 'aa'}] , 'r')
5372 call assert_equal(1 , line('$'))
5373 call assert_equal(['Xfile1|10| aa'] , getline(1 , '$'))
5374 call assert_equal([{'lnum': 10 , 'end_lnum': 0 , 'bufnr': bufnr('Xfile1') , 'col': 0 , 'end_col': 0 , 'pattern': '' , 'valid': 1 , 'vcol': 0 , 'nr': -1 , 'type': '' , 'module': '' , 'text': 'aa'}] , getqflist())
5375
5376 call setqflist([{'lnum': 10 , 'end_lnum': 0 , 'bufnr': bufnr('Xfile1') , 'col': 0 , 'end_col': 0 , 'pattern': '' , 'valid': 1 , 'vcol': 0 , 'nr': -1 , 'type': '' , 'module': '' , 'text': 'aa'}] , 'r')
5377 call assert_equal(1 , line('$'))
5378 call assert_equal(['Xfile1|10| aa'] , getline(1 , '$'))
5379 call assert_equal([{'lnum': 10 , 'end_lnum': 0 , 'bufnr': bufnr('Xfile1') , 'col': 0 , 'end_col': 0 , 'pattern': '' , 'valid': 1 , 'vcol': 0 , 'nr': -1 , 'type': '' , 'module': '' , 'text': 'aa'}] , getqflist())
5380
5381 call setqflist([{'lnum': 10 , 'end_lnum': -123 , 'bufnr': bufnr('Xfile1') , 'col': 0 , 'end_col': -456 , 'pattern': '' , 'valid': 1 , 'vcol': 0 , 'nr': -1 , 'type': '' , 'module': '' , 'text': 'aa'}] , 'r')
5382 call assert_equal(1 , line('$'))
5383 call assert_equal(['Xfile1|10| aa'] , getline(1 , '$'))
5384 call assert_equal([{'lnum': 10 , 'end_lnum': -123 , 'bufnr': bufnr('Xfile1') , 'col': 0 , 'end_col': -456 , 'pattern': '' , 'valid': 1 , 'vcol': 0 , 'nr': -1 , 'type': '' , 'module': '' , 'text': 'aa'}] , getqflist())
5385
5386 call setqflist([{'lnum': 10 , 'end_lnum': -123 , 'bufnr': bufnr('Xfile1') , 'col': 666 , 'end_col': 0 , 'pattern': '' , 'valid': 1 , 'vcol': 0 , 'nr': -1 , 'type': '' , 'module': '' , 'text': 'aa'}] , 'r')
5387 call assert_equal(1 , line('$'))
5388 call assert_equal(['Xfile1|10 col 666| aa'] , getline(1 , '$'))
5389 call assert_equal([{'lnum': 10 , 'end_lnum': -123 , 'bufnr': bufnr('Xfile1') , 'col': 666 , 'end_col': 0 , 'pattern': '' , 'valid': 1 , 'vcol': 0 , 'nr': -1 , 'type': '' , 'module': '' , 'text': 'aa'}] , getqflist())
5390
5391 call setqflist([{'lnum': 10 , 'end_lnum': -123 , 'bufnr': bufnr('Xfile1') , 'col': 666 , 'end_col': -456 , 'pattern': '' , 'valid': 1 , 'vcol': 0 , 'nr': -1 , 'type': '' , 'module': '' , 'text': 'aa'}] , 'r')
5392 call assert_equal(1 , line('$'))
5393 call assert_equal(['Xfile1|10 col 666| aa'] , getline(1 , '$'))
5394 call assert_equal([{'lnum': 10 , 'end_lnum': -123 , 'bufnr': bufnr('Xfile1') , 'col': 666 , 'end_col': -456 , 'pattern': '' , 'valid': 1 , 'vcol': 0 , 'nr': -1 , 'type': '' , 'module': '' , 'text': 'aa'}] , getqflist())
5395
5396 call setqflist([{'lnum': 10 , 'end_lnum': -123 , 'bufnr': bufnr('Xfile1') , 'col': 666 , 'end_col': 222 , 'pattern': '' , 'valid': 1 , 'vcol': 0 , 'nr': -1 , 'type': '' , 'module': '' , 'text': 'aa'}] , 'r')
5397 call assert_equal(1 , line('$'))
5398 call assert_equal(['Xfile1|10 col 666-222| aa'] , getline(1 , '$'))
5399 call assert_equal([{'lnum': 10 , 'end_lnum': -123 , 'bufnr': bufnr('Xfile1') , 'col': 666 , 'end_col': 222 , 'pattern': '' , 'valid': 1 , 'vcol': 0 , 'nr': -1 , 'type': '' , 'module': '' , 'text': 'aa'}] , getqflist())
5400
5401 call setqflist([{'lnum': 10 , 'end_lnum': 6 , 'bufnr': bufnr('Xfile1') , 'col': 666 , 'end_col': 222 , 'pattern': '' , 'valid': 1 , 'vcol': 0 , 'nr': -1 , 'type': '' , 'module': '' , 'text': 'aa'}] , 'r')
5402 call assert_equal(1 , line('$'))
5403 call assert_equal(['Xfile1|10-6 col 666-222| aa'] , getline(1 , '$'))
5404 call assert_equal([{'lnum': 10 , 'end_lnum': 6 , 'bufnr': bufnr('Xfile1') , 'col': 666 , 'end_col': 222 , 'pattern': '' , 'valid': 1 , 'vcol': 0 , 'nr': -1 , 'type': '' , 'module': '' , 'text': 'aa'}] , getqflist())
5370 cclose 5405 cclose
5371 endfunc 5406 endfunc
5372 5407
5373 " Test for very weird problem: autocommand causes a failure, resulting opening 5408 " Test for very weird problem: autocommand causes a failure, resulting opening
5374 " the quickfix window to fail. This still splits the window, but otherwise 5409 " the quickfix window to fail. This still splits the window, but otherwise