comparison src/testdir/test_bufline.vim @ 16668:81be817c9d9a v8.1.1336

patch 8.1.1336: some eval functionality is not covered by tests commit https://github.com/vim/vim/commit/17aca707f92235b6f962e637e8073162d18e6de2 Author: Bram Moolenaar <Bram@vim.org> Date: Thu May 16 22:24:55 2019 +0200 patch 8.1.1336: some eval functionality is not covered by tests Problem: Some eval functionality is not covered by tests. Solution: Add a few more test cases. (Masato Nishihata, closes https://github.com/vim/vim/issues/4374)
author Bram Moolenaar <Bram@vim.org>
date Thu, 16 May 2019 22:30:06 +0200
parents a3b5cbd2effe
children 9c90cf08cfa8
comparison
equal deleted inserted replaced
16667:a9680e0ff089 16668:81be817c9d9a
6 new 6 new
7 let b = bufnr('%') 7 let b = bufnr('%')
8 hide 8 hide
9 call assert_equal(0, setbufline(b, 1, ['foo', 'bar'])) 9 call assert_equal(0, setbufline(b, 1, ['foo', 'bar']))
10 call assert_equal(['foo'], getbufline(b, 1)) 10 call assert_equal(['foo'], getbufline(b, 1))
11 call assert_equal(['bar'], getbufline(b, 2)) 11 call assert_equal(['bar'], getbufline(b, '$'))
12 call assert_equal(['foo', 'bar'], getbufline(b, 1, 2)) 12 call assert_equal(['foo', 'bar'], getbufline(b, 1, 2))
13 exe "bd!" b 13 exe "bd!" b
14 call assert_equal([], getbufline(b, 1, 2)) 14 call assert_equal([], getbufline(b, 1, 2))
15 15
16 split Xtest 16 split Xtest
79 79
80 split Xtest 80 split Xtest
81 call setline(1, ['a', 'b', 'c']) 81 call setline(1, ['a', 'b', 'c'])
82 let b = bufnr('%') 82 let b = bufnr('%')
83 wincmd w 83 wincmd w
84 call assert_equal(1, appendbufline(b, -1, ['x']))
84 call assert_equal(1, appendbufline(b, 4, ['x'])) 85 call assert_equal(1, appendbufline(b, 4, ['x']))
85 call assert_equal(1, appendbufline(1234, 1, ['x'])) 86 call assert_equal(1, appendbufline(1234, 1, ['x']))
86 call assert_equal(0, appendbufline(b, 3, ['d', 'e'])) 87 call assert_equal(0, appendbufline(b, 3, ['d', 'e']))
87 call assert_equal(['c'], getbufline(b, 3)) 88 call assert_equal(['c'], getbufline(b, 3))
88 call assert_equal(['d'], getbufline(b, 4)) 89 call assert_equal(['d'], getbufline(b, 4))
128 call assert_equal(0, deletebufline(b, 2, 8)) 129 call assert_equal(0, deletebufline(b, 2, 8))
129 call assert_equal(['aaa'], getbufline(b, 1, 2)) 130 call assert_equal(['aaa'], getbufline(b, 1, 2))
130 exe "bd!" b 131 exe "bd!" b
131 call assert_equal(1, deletebufline(b, 1)) 132 call assert_equal(1, deletebufline(b, 1))
132 133
134 call assert_equal(1, deletebufline(-1, 1))
135
133 split Xtest 136 split Xtest
134 call setline(1, ['a', 'b', 'c']) 137 call setline(1, ['a', 'b', 'c'])
138 call cursor(line('$'), 1)
135 let b = bufnr('%') 139 let b = bufnr('%')
136 wincmd w 140 wincmd w
137 call assert_equal(1, deletebufline(b, 4)) 141 call assert_equal(1, deletebufline(b, 4))
138 call assert_equal(0, deletebufline(b, 1)) 142 call assert_equal(0, deletebufline(b, 1))
139 call assert_equal(['b', 'c'], getbufline(b, 1, 2)) 143 call assert_equal(['b', 'c'], getbufline(b, 1, 2))