Mercurial > vim
comparison src/testdir/test_quickfix.vim @ 22099:b7cc5d8ea702 v8.2.1599
patch 8.2.1599: missing line end when skipping a long line with :cgetfile
Commit: https://github.com/vim/vim/commit/59941cbd8035415d68683edc4e571306b10669ad
Author: Bram Moolenaar <Bram@vim.org>
Date: Sat Sep 5 17:03:40 2020 +0200
patch 8.2.1599: missing line end when skipping a long line with :cgetfile
Problem: Missing line end when skipping a long line with :cgetfile.
Solution: Fix off-by-one error. (closes https://github.com/vim/vim/issues/6870)
author | Bram Moolenaar <Bram@vim.org> |
---|---|
date | Sat, 05 Sep 2020 17:15:03 +0200 |
parents | ff21e2962490 |
children | c3c9830c7cdc |
comparison
equal
deleted
inserted
replaced
22098:17faee57791f | 22099:b7cc5d8ea702 |
---|---|
1742 func Test_long_lines() | 1742 func Test_long_lines() |
1743 call s:long_lines_tests('c') | 1743 call s:long_lines_tests('c') |
1744 call s:long_lines_tests('l') | 1744 call s:long_lines_tests('l') |
1745 endfunc | 1745 endfunc |
1746 | 1746 |
1747 func Test_cgetfile_on_long_lines() | |
1748 " Problematic values if the line is longer than 4096 bytes. Then 1024 bytes | |
1749 " are read at a time. | |
1750 for len in [4078, 4079, 4080, 5102, 5103, 5104, 6126, 6127, 6128, 7150, 7151, 7152] | |
1751 let lines = [ | |
1752 \ '/tmp/file1:1:1:aaa', | |
1753 \ '/tmp/file2:1:1:%s', | |
1754 \ '/tmp/file3:1:1:bbb', | |
1755 \ '/tmp/file4:1:1:ccc', | |
1756 \ ] | |
1757 let lines[1] = substitute(lines[1], '%s', repeat('x', len), '') | |
1758 call writefile(lines, 'Xcqetfile.txt') | |
1759 cgetfile Xcqetfile.txt | |
1760 call assert_equal(4, getqflist(#{size: v:true}).size, 'with length ' .. len) | |
1761 endfor | |
1762 call delete('Xcqetfile.txt') | |
1763 endfunc | |
1764 | |
1747 func s:create_test_file(filename) | 1765 func s:create_test_file(filename) |
1748 let l = [] | 1766 let l = [] |
1749 for i in range(1, 20) | 1767 for i in range(1, 20) |
1750 call add(l, 'Line' . i) | 1768 call add(l, 'Line' . i) |
1751 endfor | 1769 endfor |