Mercurial > vim
annotate src/testdir/test_scroll_opt.vim @ 27762:3196066c5795 v8.2.4407
patch 8.2.4407: Vim9: some code not covered by tests
Commit: https://github.com/vim/vim/commit/e08be09a08485e8c919f46c05223c1ccfdaf175d
Author: Bram Moolenaar <Bram@vim.org>
Date: Thu Feb 17 13:08:26 2022 +0000
patch 8.2.4407: Vim9: some code not covered by tests
Problem: Vim9: some code not covered by tests.
Solution: Add more tests. Avoid giving two errors. Remove dead code.
author | Bram Moolenaar <Bram@vim.org> |
---|---|
date | Thu, 17 Feb 2022 14:15:04 +0100 |
parents | 08940efa6b4e |
children | 6c6ac189a05f |
rev | line source |
---|---|
12718
f8f505ffc0a6
patch 8.0.1237: ":set scroll&" often gives an error
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1 " Test for reset 'scroll' |
f8f505ffc0a6
patch 8.0.1237: ":set scroll&" often gives an error
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
2 |
f8f505ffc0a6
patch 8.0.1237: ":set scroll&" often gives an error
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
3 func Test_reset_scroll() |
f8f505ffc0a6
patch 8.0.1237: ":set scroll&" often gives an error
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
4 let scr = &l:scroll |
f8f505ffc0a6
patch 8.0.1237: ":set scroll&" often gives an error
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
5 |
f8f505ffc0a6
patch 8.0.1237: ":set scroll&" often gives an error
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
6 setlocal scroll=1 |
f8f505ffc0a6
patch 8.0.1237: ":set scroll&" often gives an error
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
7 setlocal scroll& |
f8f505ffc0a6
patch 8.0.1237: ":set scroll&" often gives an error
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
8 call assert_equal(scr, &l:scroll) |
f8f505ffc0a6
patch 8.0.1237: ":set scroll&" often gives an error
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
9 |
f8f505ffc0a6
patch 8.0.1237: ":set scroll&" often gives an error
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
10 setlocal scroll=1 |
f8f505ffc0a6
patch 8.0.1237: ":set scroll&" often gives an error
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
11 setlocal scroll=0 |
f8f505ffc0a6
patch 8.0.1237: ":set scroll&" often gives an error
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
12 call assert_equal(scr, &l:scroll) |
f8f505ffc0a6
patch 8.0.1237: ":set scroll&" often gives an error
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
13 |
f8f505ffc0a6
patch 8.0.1237: ":set scroll&" often gives an error
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
14 try |
f8f505ffc0a6
patch 8.0.1237: ":set scroll&" often gives an error
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
15 execute 'setlocal scroll=' . (winheight(0) + 1) |
f8f505ffc0a6
patch 8.0.1237: ":set scroll&" often gives an error
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
16 " not reached |
f8f505ffc0a6
patch 8.0.1237: ":set scroll&" often gives an error
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
17 call assert_false(1) |
f8f505ffc0a6
patch 8.0.1237: ":set scroll&" often gives an error
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
18 catch |
f8f505ffc0a6
patch 8.0.1237: ":set scroll&" often gives an error
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
19 call assert_exception('E49:') |
f8f505ffc0a6
patch 8.0.1237: ":set scroll&" often gives an error
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
20 endtry |
f8f505ffc0a6
patch 8.0.1237: ":set scroll&" often gives an error
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
21 |
f8f505ffc0a6
patch 8.0.1237: ":set scroll&" often gives an error
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
22 split |
f8f505ffc0a6
patch 8.0.1237: ":set scroll&" often gives an error
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
23 |
f8f505ffc0a6
patch 8.0.1237: ":set scroll&" often gives an error
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
24 let scr = &l:scroll |
f8f505ffc0a6
patch 8.0.1237: ":set scroll&" often gives an error
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
25 |
f8f505ffc0a6
patch 8.0.1237: ":set scroll&" often gives an error
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
26 setlocal scroll=1 |
f8f505ffc0a6
patch 8.0.1237: ":set scroll&" often gives an error
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
27 setlocal scroll& |
f8f505ffc0a6
patch 8.0.1237: ":set scroll&" often gives an error
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
28 call assert_equal(scr, &l:scroll) |
f8f505ffc0a6
patch 8.0.1237: ":set scroll&" often gives an error
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
29 |
f8f505ffc0a6
patch 8.0.1237: ":set scroll&" often gives an error
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
30 setlocal scroll=1 |
f8f505ffc0a6
patch 8.0.1237: ":set scroll&" often gives an error
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
31 setlocal scroll=0 |
f8f505ffc0a6
patch 8.0.1237: ":set scroll&" often gives an error
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
32 call assert_equal(scr, &l:scroll) |
f8f505ffc0a6
patch 8.0.1237: ":set scroll&" often gives an error
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
33 |
f8f505ffc0a6
patch 8.0.1237: ":set scroll&" often gives an error
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
34 quit! |
f8f505ffc0a6
patch 8.0.1237: ":set scroll&" often gives an error
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
35 endfunc |
21765
08940efa6b4e
patch 8.2.1432: various inconsistencies in test files
Bram Moolenaar <Bram@vim.org>
parents:
12718
diff
changeset
|
36 |
08940efa6b4e
patch 8.2.1432: various inconsistencies in test files
Bram Moolenaar <Bram@vim.org>
parents:
12718
diff
changeset
|
37 " vim: shiftwidth=2 sts=2 expandtab |