Mercurial > vim
comparison src/testdir/test_bufline.vim @ 20120:16460964c304 v8.2.0615
patch 8.2.0615: regexp benchmark stest is old style
Commit: https://github.com/vim/vim/commit/ad48e6c1590842ab6d48e6caba3e9250734dae27
Author: Bram Moolenaar <Bram@vim.org>
Date: Tue Apr 21 22:19:45 2020 +0200
patch 8.2.0615: regexp benchmark stest is old style
Problem: Regexp benchmark stest is old style.
Solution: Make it a new style test. Fix using a NULL list. Add more tests.
(Yegappan Lakshmanan, closes #5963)
author | Bram Moolenaar <Bram@vim.org> |
---|---|
date | Tue, 21 Apr 2020 22:30:03 +0200 |
parents | c087099e9163 |
children | 2fb397573541 |
comparison
equal
deleted
inserted
replaced
20119:35c4224dc232 | 20120:16460964c304 |
---|---|
17 | 17 |
18 split Xtest | 18 split Xtest |
19 call setline(1, ['a', 'b', 'c']) | 19 call setline(1, ['a', 'b', 'c']) |
20 let b = bufnr('%') | 20 let b = bufnr('%') |
21 wincmd w | 21 wincmd w |
22 | |
23 call assert_equal(1, setbufline(b, 5, 'x')) | |
22 call assert_equal(1, setbufline(b, 5, ['x'])) | 24 call assert_equal(1, setbufline(b, 5, ['x'])) |
25 call assert_equal(1, setbufline(b, 5, [])) | |
26 call assert_equal(1, setbufline(b, 5, test_null_list())) | |
27 | |
28 call assert_equal(1, 'x'->setbufline(bufnr('$') + 1, 1)) | |
23 call assert_equal(1, ['x']->setbufline(bufnr('$') + 1, 1)) | 29 call assert_equal(1, ['x']->setbufline(bufnr('$') + 1, 1)) |
30 call assert_equal(1, []->setbufline(bufnr('$') + 1, 1)) | |
31 call assert_equal(1, test_null_list()->setbufline(bufnr('$') + 1, 1)) | |
32 | |
33 call assert_equal(['a', 'b', 'c'], getbufline(b, 1, '$')) | |
34 | |
24 call assert_equal(0, setbufline(b, 4, ['d', 'e'])) | 35 call assert_equal(0, setbufline(b, 4, ['d', 'e'])) |
25 call assert_equal(['c'], b->getbufline(3)) | 36 call assert_equal(['c'], b->getbufline(3)) |
26 call assert_equal(['d'], getbufline(b, 4)) | 37 call assert_equal(['d'], getbufline(b, 4)) |
27 call assert_equal(['e'], getbufline(b, 5)) | 38 call assert_equal(['e'], getbufline(b, 5)) |
28 call assert_equal([], getbufline(b, 6)) | 39 call assert_equal([], getbufline(b, 6)) |
81 | 92 |
82 split Xtest | 93 split Xtest |
83 call setline(1, ['a', 'b', 'c']) | 94 call setline(1, ['a', 'b', 'c']) |
84 let b = bufnr('%') | 95 let b = bufnr('%') |
85 wincmd w | 96 wincmd w |
97 | |
98 call assert_equal(1, appendbufline(b, -1, 'x')) | |
86 call assert_equal(1, appendbufline(b, -1, ['x'])) | 99 call assert_equal(1, appendbufline(b, -1, ['x'])) |
100 call assert_equal(1, appendbufline(b, -1, [])) | |
101 call assert_equal(1, appendbufline(b, -1, test_null_list())) | |
102 | |
103 call assert_equal(1, appendbufline(b, 4, 'x')) | |
87 call assert_equal(1, appendbufline(b, 4, ['x'])) | 104 call assert_equal(1, appendbufline(b, 4, ['x'])) |
105 call assert_equal(1, appendbufline(b, 4, [])) | |
106 call assert_equal(1, appendbufline(b, 4, test_null_list())) | |
107 | |
108 call assert_equal(1, appendbufline(1234, 1, 'x')) | |
88 call assert_equal(1, appendbufline(1234, 1, ['x'])) | 109 call assert_equal(1, appendbufline(1234, 1, ['x'])) |
110 call assert_equal(1, appendbufline(1234, 1, [])) | |
111 call assert_equal(1, appendbufline(1234, 1, test_null_list())) | |
112 | |
113 call assert_equal(0, appendbufline(b, 1, [])) | |
114 call assert_equal(0, appendbufline(b, 1, test_null_list())) | |
115 call assert_equal(1, appendbufline(b, 3, [])) | |
116 call assert_equal(1, appendbufline(b, 3, test_null_list())) | |
117 | |
118 call assert_equal(['a', 'b', 'c'], getbufline(b, 1, '$')) | |
119 | |
89 call assert_equal(0, appendbufline(b, 3, ['d', 'e'])) | 120 call assert_equal(0, appendbufline(b, 3, ['d', 'e'])) |
90 call assert_equal(['c'], getbufline(b, 3)) | 121 call assert_equal(['c'], getbufline(b, 3)) |
91 call assert_equal(['d'], getbufline(b, 4)) | 122 call assert_equal(['d'], getbufline(b, 4)) |
92 call assert_equal(['e'], getbufline(b, 5)) | 123 call assert_equal(['e'], getbufline(b, 5)) |
93 call assert_equal([], getbufline(b, 6)) | 124 call assert_equal([], getbufline(b, 6)) |