diff options
Diffstat (limited to 'src/nvim/testdir/test_functions.vim')
-rw-r--r-- | src/nvim/testdir/test_functions.vim | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/src/nvim/testdir/test_functions.vim b/src/nvim/testdir/test_functions.vim index e2a035b0b2..8fde63b55f 100644 --- a/src/nvim/testdir/test_functions.vim +++ b/src/nvim/testdir/test_functions.vim @@ -701,6 +701,7 @@ endfunc func Test_byte2line_line2byte() new + set endofline call setline(1, ['a', 'bc', 'd']) set fileformat=unix @@ -721,7 +722,16 @@ func Test_byte2line_line2byte() call assert_equal([-1, -1, 1, 4, 8, 11, -1], \ map(range(-1, 5), 'line2byte(v:val)')) - set fileformat& + bw! + set noendofline nofixendofline + normal a- + for ff in ["unix", "mac", "dos"] + let &fileformat = ff + call assert_equal(1, line2byte(1)) + call assert_equal(2, line2byte(2)) " line2byte(line("$") + 1) is the buffer size plus one (as per :help line2byte). + endfor + + set endofline& fixendofline& fileformat& bw! endfunc |