annotate src/testdir/test_changelist.vim @ 27084:6fc63c6a7ee7 v8.2.4071

patch 8.2.4071: Vim9: no detection of return in try/endtry Commit: https://github.com/vim/vim/commit/53c296112edd8471eb63afbca03f96bad164c813 Author: Bram Moolenaar <Bram@vim.org> Date: Wed Jan 12 16:18:18 2022 +0000 patch 8.2.4071: Vim9: no detection of return in try/endtry Problem: Vim9: no detection of return in try/endtry. (Dominique Pell?) Solution: Check if any of the blocks inside try/endtry did not end in return.
author Bram Moolenaar <Bram@vim.org>
date Wed, 12 Jan 2022 17:30:07 +0100
parents 255bc9a08e58
children 1170b35651a5
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
13280
fbda23eb0996 patch 8.0.1514: getting the list of changes is not easy
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
1 " Tests for the changelist functionality
fbda23eb0996 patch 8.0.1514: getting the list of changes is not easy
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
2
fbda23eb0996 patch 8.0.1514: getting the list of changes is not easy
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
3 " Tests for the getchangelist() function
fbda23eb0996 patch 8.0.1514: getting the list of changes is not easy
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
4 func Test_getchangelist()
fbda23eb0996 patch 8.0.1514: getting the list of changes is not easy
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
5 bwipe!
fbda23eb0996 patch 8.0.1514: getting the list of changes is not easy
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
6 enew
17857
4935244c1128 patch 8.1.1925: more functions can be used as methods
Bram Moolenaar <Bram@vim.org>
parents: 13290
diff changeset
7 call assert_equal([], 10->getchangelist())
4935244c1128 patch 8.1.1925: more functions can be used as methods
Bram Moolenaar <Bram@vim.org>
parents: 13290
diff changeset
8 call assert_equal([[], 0], getchangelist())
13280
fbda23eb0996 patch 8.0.1514: getting the list of changes is not easy
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
9
fbda23eb0996 patch 8.0.1514: getting the list of changes is not easy
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
10 call writefile(['line1', 'line2', 'line3'], 'Xfile1.txt')
fbda23eb0996 patch 8.0.1514: getting the list of changes is not easy
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
11 call writefile(['line1', 'line2', 'line3'], 'Xfile2.txt')
fbda23eb0996 patch 8.0.1514: getting the list of changes is not easy
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
12
fbda23eb0996 patch 8.0.1514: getting the list of changes is not easy
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
13 edit Xfile1.txt
fbda23eb0996 patch 8.0.1514: getting the list of changes is not easy
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
14 exe "normal 1Goline\<C-G>u1.1"
fbda23eb0996 patch 8.0.1514: getting the list of changes is not easy
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
15 exe "normal 3Goline\<C-G>u2.1"
fbda23eb0996 patch 8.0.1514: getting the list of changes is not easy
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
16 exe "normal 5Goline\<C-G>u3.1"
fbda23eb0996 patch 8.0.1514: getting the list of changes is not easy
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
17 normal g;
fbda23eb0996 patch 8.0.1514: getting the list of changes is not easy
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
18 call assert_equal([[
fbda23eb0996 patch 8.0.1514: getting the list of changes is not easy
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
19 \ {'lnum' : 2, 'col' : 4, 'coladd' : 0},
fbda23eb0996 patch 8.0.1514: getting the list of changes is not easy
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
20 \ {'lnum' : 4, 'col' : 4, 'coladd' : 0},
fbda23eb0996 patch 8.0.1514: getting the list of changes is not easy
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
21 \ {'lnum' : 6, 'col' : 4, 'coladd' : 0}], 2],
13290
3f3d9ed211b2 patch 8.0.1519: getchangelist() does not use argument as bufname()
Christian Brabandt <cb@256bit.org>
parents: 13280
diff changeset
22 \ getchangelist('%'))
13280
fbda23eb0996 patch 8.0.1514: getting the list of changes is not easy
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
23
fbda23eb0996 patch 8.0.1514: getting the list of changes is not easy
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
24 hide edit Xfile2.txt
fbda23eb0996 patch 8.0.1514: getting the list of changes is not easy
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
25 exe "normal 1GOline\<C-G>u1.0"
fbda23eb0996 patch 8.0.1514: getting the list of changes is not easy
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
26 exe "normal 2Goline\<C-G>u2.0"
fbda23eb0996 patch 8.0.1514: getting the list of changes is not easy
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
27 call assert_equal([[
fbda23eb0996 patch 8.0.1514: getting the list of changes is not easy
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
28 \ {'lnum' : 1, 'col' : 6, 'coladd' : 0},
fbda23eb0996 patch 8.0.1514: getting the list of changes is not easy
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
29 \ {'lnum' : 3, 'col' : 6, 'coladd' : 0}], 2],
13290
3f3d9ed211b2 patch 8.0.1519: getchangelist() does not use argument as bufname()
Christian Brabandt <cb@256bit.org>
parents: 13280
diff changeset
30 \ getchangelist('%'))
13280
fbda23eb0996 patch 8.0.1514: getting the list of changes is not easy
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
31 hide enew
fbda23eb0996 patch 8.0.1514: getting the list of changes is not easy
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
32
fbda23eb0996 patch 8.0.1514: getting the list of changes is not easy
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
33 call assert_equal([[
fbda23eb0996 patch 8.0.1514: getting the list of changes is not easy
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
34 \ {'lnum' : 2, 'col' : 4, 'coladd' : 0},
fbda23eb0996 patch 8.0.1514: getting the list of changes is not easy
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
35 \ {'lnum' : 4, 'col' : 4, 'coladd' : 0},
fbda23eb0996 patch 8.0.1514: getting the list of changes is not easy
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
36 \ {'lnum' : 6, 'col' : 4, 'coladd' : 0}], 3], getchangelist(2))
fbda23eb0996 patch 8.0.1514: getting the list of changes is not easy
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
37 call assert_equal([[
fbda23eb0996 patch 8.0.1514: getting the list of changes is not easy
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
38 \ {'lnum' : 1, 'col' : 6, 'coladd' : 0},
fbda23eb0996 patch 8.0.1514: getting the list of changes is not easy
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
39 \ {'lnum' : 3, 'col' : 6, 'coladd' : 0}], 2], getchangelist(3))
fbda23eb0996 patch 8.0.1514: getting the list of changes is not easy
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
40
fbda23eb0996 patch 8.0.1514: getting the list of changes is not easy
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
41 bwipe!
fbda23eb0996 patch 8.0.1514: getting the list of changes is not easy
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
42 call delete('Xfile1.txt')
fbda23eb0996 patch 8.0.1514: getting the list of changes is not easy
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
43 call delete('Xfile2.txt')
fbda23eb0996 patch 8.0.1514: getting the list of changes is not easy
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
44 endfunc
19625
f70a3c1000bb patch 8.2.0369: various Normal mode commands not fully tested
Bram Moolenaar <Bram@vim.org>
parents: 17857
diff changeset
45
f70a3c1000bb patch 8.2.0369: various Normal mode commands not fully tested
Bram Moolenaar <Bram@vim.org>
parents: 17857
diff changeset
46 " vim: shiftwidth=2 sts=2 expandtab