Mercurial > vim
annotate src/testdir/test_expr.vim @ 9580:624a90bf4f05
Added tag v7.4.2067 for changeset 2fb7e008ac9b4bff46a8281d52271406cc94bb59
author | Christian Brabandt <cb@256bit.org> |
---|---|
date | Mon, 18 Jul 2016 22:30:06 +0200 |
parents | d18d71ae21e5 |
children | bf204ab1ce7d |
rev | line source |
---|---|
8635
3a38d465f731
commit https://github.com/vim/vim/commit/f0e86a0dbddc18568910e9e4aaae0cd88ca8087a
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1 " Tests for expressions. |
3a38d465f731
commit https://github.com/vim/vim/commit/f0e86a0dbddc18568910e9e4aaae0cd88ca8087a
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
2 |
3a38d465f731
commit https://github.com/vim/vim/commit/f0e86a0dbddc18568910e9e4aaae0cd88ca8087a
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
3 func Test_equal() |
3a38d465f731
commit https://github.com/vim/vim/commit/f0e86a0dbddc18568910e9e4aaae0cd88ca8087a
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
4 let base = {} |
3a38d465f731
commit https://github.com/vim/vim/commit/f0e86a0dbddc18568910e9e4aaae0cd88ca8087a
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
5 func base.method() |
3a38d465f731
commit https://github.com/vim/vim/commit/f0e86a0dbddc18568910e9e4aaae0cd88ca8087a
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
6 return 1 |
3a38d465f731
commit https://github.com/vim/vim/commit/f0e86a0dbddc18568910e9e4aaae0cd88ca8087a
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
7 endfunc |
3a38d465f731
commit https://github.com/vim/vim/commit/f0e86a0dbddc18568910e9e4aaae0cd88ca8087a
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
8 func base.other() dict |
3a38d465f731
commit https://github.com/vim/vim/commit/f0e86a0dbddc18568910e9e4aaae0cd88ca8087a
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
9 return 1 |
3a38d465f731
commit https://github.com/vim/vim/commit/f0e86a0dbddc18568910e9e4aaae0cd88ca8087a
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
10 endfunc |
3a38d465f731
commit https://github.com/vim/vim/commit/f0e86a0dbddc18568910e9e4aaae0cd88ca8087a
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
11 let instance = copy(base) |
3a38d465f731
commit https://github.com/vim/vim/commit/f0e86a0dbddc18568910e9e4aaae0cd88ca8087a
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
12 call assert_true(base.method == instance.method) |
3a38d465f731
commit https://github.com/vim/vim/commit/f0e86a0dbddc18568910e9e4aaae0cd88ca8087a
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
13 call assert_true([base.method] == [instance.method]) |
3a38d465f731
commit https://github.com/vim/vim/commit/f0e86a0dbddc18568910e9e4aaae0cd88ca8087a
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
14 call assert_true(base.other == instance.other) |
3a38d465f731
commit https://github.com/vim/vim/commit/f0e86a0dbddc18568910e9e4aaae0cd88ca8087a
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
15 call assert_true([base.other] == [instance.other]) |
3a38d465f731
commit https://github.com/vim/vim/commit/f0e86a0dbddc18568910e9e4aaae0cd88ca8087a
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
16 |
3a38d465f731
commit https://github.com/vim/vim/commit/f0e86a0dbddc18568910e9e4aaae0cd88ca8087a
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
17 call assert_false(base.method == base.other) |
3a38d465f731
commit https://github.com/vim/vim/commit/f0e86a0dbddc18568910e9e4aaae0cd88ca8087a
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
18 call assert_false([base.method] == [base.other]) |
3a38d465f731
commit https://github.com/vim/vim/commit/f0e86a0dbddc18568910e9e4aaae0cd88ca8087a
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
19 call assert_false(base.method == instance.other) |
3a38d465f731
commit https://github.com/vim/vim/commit/f0e86a0dbddc18568910e9e4aaae0cd88ca8087a
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
20 call assert_false([base.method] == [instance.other]) |
3a38d465f731
commit https://github.com/vim/vim/commit/f0e86a0dbddc18568910e9e4aaae0cd88ca8087a
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
21 |
3a38d465f731
commit https://github.com/vim/vim/commit/f0e86a0dbddc18568910e9e4aaae0cd88ca8087a
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
22 call assert_fails('echo base.method > instance.method') |
3a38d465f731
commit https://github.com/vim/vim/commit/f0e86a0dbddc18568910e9e4aaae0cd88ca8087a
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
23 endfunc |
8742
03e5171c23e5
commit https://github.com/vim/vim/commit/819821c5a95fc60797ecbb5e5ca1302e397e3d9a
Christian Brabandt <cb@256bit.org>
parents:
8635
diff
changeset
|
24 |
03e5171c23e5
commit https://github.com/vim/vim/commit/819821c5a95fc60797ecbb5e5ca1302e397e3d9a
Christian Brabandt <cb@256bit.org>
parents:
8635
diff
changeset
|
25 func Test_version() |
03e5171c23e5
commit https://github.com/vim/vim/commit/819821c5a95fc60797ecbb5e5ca1302e397e3d9a
Christian Brabandt <cb@256bit.org>
parents:
8635
diff
changeset
|
26 call assert_true(has('patch-7.4.001')) |
03e5171c23e5
commit https://github.com/vim/vim/commit/819821c5a95fc60797ecbb5e5ca1302e397e3d9a
Christian Brabandt <cb@256bit.org>
parents:
8635
diff
changeset
|
27 call assert_true(has('patch-7.4.01')) |
03e5171c23e5
commit https://github.com/vim/vim/commit/819821c5a95fc60797ecbb5e5ca1302e397e3d9a
Christian Brabandt <cb@256bit.org>
parents:
8635
diff
changeset
|
28 call assert_true(has('patch-7.4.1')) |
03e5171c23e5
commit https://github.com/vim/vim/commit/819821c5a95fc60797ecbb5e5ca1302e397e3d9a
Christian Brabandt <cb@256bit.org>
parents:
8635
diff
changeset
|
29 call assert_true(has('patch-6.9.999')) |
03e5171c23e5
commit https://github.com/vim/vim/commit/819821c5a95fc60797ecbb5e5ca1302e397e3d9a
Christian Brabandt <cb@256bit.org>
parents:
8635
diff
changeset
|
30 call assert_true(has('patch-7.1.999')) |
03e5171c23e5
commit https://github.com/vim/vim/commit/819821c5a95fc60797ecbb5e5ca1302e397e3d9a
Christian Brabandt <cb@256bit.org>
parents:
8635
diff
changeset
|
31 call assert_true(has('patch-7.4.123')) |
03e5171c23e5
commit https://github.com/vim/vim/commit/819821c5a95fc60797ecbb5e5ca1302e397e3d9a
Christian Brabandt <cb@256bit.org>
parents:
8635
diff
changeset
|
32 |
03e5171c23e5
commit https://github.com/vim/vim/commit/819821c5a95fc60797ecbb5e5ca1302e397e3d9a
Christian Brabandt <cb@256bit.org>
parents:
8635
diff
changeset
|
33 call assert_false(has('patch-7')) |
03e5171c23e5
commit https://github.com/vim/vim/commit/819821c5a95fc60797ecbb5e5ca1302e397e3d9a
Christian Brabandt <cb@256bit.org>
parents:
8635
diff
changeset
|
34 call assert_false(has('patch-7.4')) |
03e5171c23e5
commit https://github.com/vim/vim/commit/819821c5a95fc60797ecbb5e5ca1302e397e3d9a
Christian Brabandt <cb@256bit.org>
parents:
8635
diff
changeset
|
35 call assert_false(has('patch-7.4.')) |
03e5171c23e5
commit https://github.com/vim/vim/commit/819821c5a95fc60797ecbb5e5ca1302e397e3d9a
Christian Brabandt <cb@256bit.org>
parents:
8635
diff
changeset
|
36 call assert_false(has('patch-9.1.0')) |
03e5171c23e5
commit https://github.com/vim/vim/commit/819821c5a95fc60797ecbb5e5ca1302e397e3d9a
Christian Brabandt <cb@256bit.org>
parents:
8635
diff
changeset
|
37 call assert_false(has('patch-9.9.1')) |
03e5171c23e5
commit https://github.com/vim/vim/commit/819821c5a95fc60797ecbb5e5ca1302e397e3d9a
Christian Brabandt <cb@256bit.org>
parents:
8635
diff
changeset
|
38 endfunc |
8839
9fa567d13551
commit https://github.com/vim/vim/commit/0921ecff1c5a74541bad6c073e8ade32247403d8
Christian Brabandt <cb@256bit.org>
parents:
8742
diff
changeset
|
39 |
9fa567d13551
commit https://github.com/vim/vim/commit/0921ecff1c5a74541bad6c073e8ade32247403d8
Christian Brabandt <cb@256bit.org>
parents:
8742
diff
changeset
|
40 func Test_dict() |
9fa567d13551
commit https://github.com/vim/vim/commit/0921ecff1c5a74541bad6c073e8ade32247403d8
Christian Brabandt <cb@256bit.org>
parents:
8742
diff
changeset
|
41 let d = {'': 'empty', 'a': 'a', 0: 'zero'} |
9fa567d13551
commit https://github.com/vim/vim/commit/0921ecff1c5a74541bad6c073e8ade32247403d8
Christian Brabandt <cb@256bit.org>
parents:
8742
diff
changeset
|
42 call assert_equal('empty', d['']) |
9fa567d13551
commit https://github.com/vim/vim/commit/0921ecff1c5a74541bad6c073e8ade32247403d8
Christian Brabandt <cb@256bit.org>
parents:
8742
diff
changeset
|
43 call assert_equal('a', d['a']) |
9fa567d13551
commit https://github.com/vim/vim/commit/0921ecff1c5a74541bad6c073e8ade32247403d8
Christian Brabandt <cb@256bit.org>
parents:
8742
diff
changeset
|
44 call assert_equal('zero', d[0]) |
9fa567d13551
commit https://github.com/vim/vim/commit/0921ecff1c5a74541bad6c073e8ade32247403d8
Christian Brabandt <cb@256bit.org>
parents:
8742
diff
changeset
|
45 call assert_true(has_key(d, '')) |
9fa567d13551
commit https://github.com/vim/vim/commit/0921ecff1c5a74541bad6c073e8ade32247403d8
Christian Brabandt <cb@256bit.org>
parents:
8742
diff
changeset
|
46 call assert_true(has_key(d, 'a')) |
9fa567d13551
commit https://github.com/vim/vim/commit/0921ecff1c5a74541bad6c073e8ade32247403d8
Christian Brabandt <cb@256bit.org>
parents:
8742
diff
changeset
|
47 |
9fa567d13551
commit https://github.com/vim/vim/commit/0921ecff1c5a74541bad6c073e8ade32247403d8
Christian Brabandt <cb@256bit.org>
parents:
8742
diff
changeset
|
48 let d[''] = 'none' |
9fa567d13551
commit https://github.com/vim/vim/commit/0921ecff1c5a74541bad6c073e8ade32247403d8
Christian Brabandt <cb@256bit.org>
parents:
8742
diff
changeset
|
49 let d['a'] = 'aaa' |
9fa567d13551
commit https://github.com/vim/vim/commit/0921ecff1c5a74541bad6c073e8ade32247403d8
Christian Brabandt <cb@256bit.org>
parents:
8742
diff
changeset
|
50 call assert_equal('none', d['']) |
9fa567d13551
commit https://github.com/vim/vim/commit/0921ecff1c5a74541bad6c073e8ade32247403d8
Christian Brabandt <cb@256bit.org>
parents:
8742
diff
changeset
|
51 call assert_equal('aaa', d['a']) |
9fa567d13551
commit https://github.com/vim/vim/commit/0921ecff1c5a74541bad6c073e8ade32247403d8
Christian Brabandt <cb@256bit.org>
parents:
8742
diff
changeset
|
52 endfunc |
8887
8bf855dea79e
commit https://github.com/vim/vim/commit/58de0e2dcc1f2d251b74892a06d71a14973f3187
Christian Brabandt <cb@256bit.org>
parents:
8839
diff
changeset
|
53 |
8bf855dea79e
commit https://github.com/vim/vim/commit/58de0e2dcc1f2d251b74892a06d71a14973f3187
Christian Brabandt <cb@256bit.org>
parents:
8839
diff
changeset
|
54 func Test_strgetchar() |
8bf855dea79e
commit https://github.com/vim/vim/commit/58de0e2dcc1f2d251b74892a06d71a14973f3187
Christian Brabandt <cb@256bit.org>
parents:
8839
diff
changeset
|
55 call assert_equal(char2nr('a'), strgetchar('axb', 0)) |
8bf855dea79e
commit https://github.com/vim/vim/commit/58de0e2dcc1f2d251b74892a06d71a14973f3187
Christian Brabandt <cb@256bit.org>
parents:
8839
diff
changeset
|
56 call assert_equal(char2nr('x'), strgetchar('axb', 1)) |
8bf855dea79e
commit https://github.com/vim/vim/commit/58de0e2dcc1f2d251b74892a06d71a14973f3187
Christian Brabandt <cb@256bit.org>
parents:
8839
diff
changeset
|
57 call assert_equal(char2nr('b'), strgetchar('axb', 2)) |
8bf855dea79e
commit https://github.com/vim/vim/commit/58de0e2dcc1f2d251b74892a06d71a14973f3187
Christian Brabandt <cb@256bit.org>
parents:
8839
diff
changeset
|
58 |
8bf855dea79e
commit https://github.com/vim/vim/commit/58de0e2dcc1f2d251b74892a06d71a14973f3187
Christian Brabandt <cb@256bit.org>
parents:
8839
diff
changeset
|
59 call assert_equal(-1, strgetchar('axb', -1)) |
8bf855dea79e
commit https://github.com/vim/vim/commit/58de0e2dcc1f2d251b74892a06d71a14973f3187
Christian Brabandt <cb@256bit.org>
parents:
8839
diff
changeset
|
60 call assert_equal(-1, strgetchar('axb', 3)) |
8bf855dea79e
commit https://github.com/vim/vim/commit/58de0e2dcc1f2d251b74892a06d71a14973f3187
Christian Brabandt <cb@256bit.org>
parents:
8839
diff
changeset
|
61 call assert_equal(-1, strgetchar('', 0)) |
8bf855dea79e
commit https://github.com/vim/vim/commit/58de0e2dcc1f2d251b74892a06d71a14973f3187
Christian Brabandt <cb@256bit.org>
parents:
8839
diff
changeset
|
62 endfunc |
8bf855dea79e
commit https://github.com/vim/vim/commit/58de0e2dcc1f2d251b74892a06d71a14973f3187
Christian Brabandt <cb@256bit.org>
parents:
8839
diff
changeset
|
63 |
8bf855dea79e
commit https://github.com/vim/vim/commit/58de0e2dcc1f2d251b74892a06d71a14973f3187
Christian Brabandt <cb@256bit.org>
parents:
8839
diff
changeset
|
64 func Test_strcharpart() |
8bf855dea79e
commit https://github.com/vim/vim/commit/58de0e2dcc1f2d251b74892a06d71a14973f3187
Christian Brabandt <cb@256bit.org>
parents:
8839
diff
changeset
|
65 call assert_equal('a', strcharpart('axb', 0, 1)) |
8bf855dea79e
commit https://github.com/vim/vim/commit/58de0e2dcc1f2d251b74892a06d71a14973f3187
Christian Brabandt <cb@256bit.org>
parents:
8839
diff
changeset
|
66 call assert_equal('x', strcharpart('axb', 1, 1)) |
8bf855dea79e
commit https://github.com/vim/vim/commit/58de0e2dcc1f2d251b74892a06d71a14973f3187
Christian Brabandt <cb@256bit.org>
parents:
8839
diff
changeset
|
67 call assert_equal('b', strcharpart('axb', 2, 1)) |
8bf855dea79e
commit https://github.com/vim/vim/commit/58de0e2dcc1f2d251b74892a06d71a14973f3187
Christian Brabandt <cb@256bit.org>
parents:
8839
diff
changeset
|
68 call assert_equal('xb', strcharpart('axb', 1)) |
8bf855dea79e
commit https://github.com/vim/vim/commit/58de0e2dcc1f2d251b74892a06d71a14973f3187
Christian Brabandt <cb@256bit.org>
parents:
8839
diff
changeset
|
69 |
8bf855dea79e
commit https://github.com/vim/vim/commit/58de0e2dcc1f2d251b74892a06d71a14973f3187
Christian Brabandt <cb@256bit.org>
parents:
8839
diff
changeset
|
70 call assert_equal('', strcharpart('axb', 1, 0)) |
8bf855dea79e
commit https://github.com/vim/vim/commit/58de0e2dcc1f2d251b74892a06d71a14973f3187
Christian Brabandt <cb@256bit.org>
parents:
8839
diff
changeset
|
71 call assert_equal('', strcharpart('axb', 1, -1)) |
8bf855dea79e
commit https://github.com/vim/vim/commit/58de0e2dcc1f2d251b74892a06d71a14973f3187
Christian Brabandt <cb@256bit.org>
parents:
8839
diff
changeset
|
72 call assert_equal('', strcharpart('axb', -1, 1)) |
8bf855dea79e
commit https://github.com/vim/vim/commit/58de0e2dcc1f2d251b74892a06d71a14973f3187
Christian Brabandt <cb@256bit.org>
parents:
8839
diff
changeset
|
73 call assert_equal('', strcharpart('axb', -2, 2)) |
8bf855dea79e
commit https://github.com/vim/vim/commit/58de0e2dcc1f2d251b74892a06d71a14973f3187
Christian Brabandt <cb@256bit.org>
parents:
8839
diff
changeset
|
74 |
8bf855dea79e
commit https://github.com/vim/vim/commit/58de0e2dcc1f2d251b74892a06d71a14973f3187
Christian Brabandt <cb@256bit.org>
parents:
8839
diff
changeset
|
75 call assert_equal('a', strcharpart('axb', -1, 2)) |
8bf855dea79e
commit https://github.com/vim/vim/commit/58de0e2dcc1f2d251b74892a06d71a14973f3187
Christian Brabandt <cb@256bit.org>
parents:
8839
diff
changeset
|
76 endfunc |
8939
36cb3aff8c1c
commit https://github.com/vim/vim/commit/517ffbee0d5b7b46320726faaa330b61f54e867c
Christian Brabandt <cb@256bit.org>
parents:
8895
diff
changeset
|
77 |
36cb3aff8c1c
commit https://github.com/vim/vim/commit/517ffbee0d5b7b46320726faaa330b61f54e867c
Christian Brabandt <cb@256bit.org>
parents:
8895
diff
changeset
|
78 func Test_getreg_empty_list() |
36cb3aff8c1c
commit https://github.com/vim/vim/commit/517ffbee0d5b7b46320726faaa330b61f54e867c
Christian Brabandt <cb@256bit.org>
parents:
8895
diff
changeset
|
79 call assert_equal('', getreg('x')) |
36cb3aff8c1c
commit https://github.com/vim/vim/commit/517ffbee0d5b7b46320726faaa330b61f54e867c
Christian Brabandt <cb@256bit.org>
parents:
8895
diff
changeset
|
80 call assert_equal([], getreg('x', 1, 1)) |
36cb3aff8c1c
commit https://github.com/vim/vim/commit/517ffbee0d5b7b46320726faaa330b61f54e867c
Christian Brabandt <cb@256bit.org>
parents:
8895
diff
changeset
|
81 let x = getreg('x', 1, 1) |
36cb3aff8c1c
commit https://github.com/vim/vim/commit/517ffbee0d5b7b46320726faaa330b61f54e867c
Christian Brabandt <cb@256bit.org>
parents:
8895
diff
changeset
|
82 let y = x |
36cb3aff8c1c
commit https://github.com/vim/vim/commit/517ffbee0d5b7b46320726faaa330b61f54e867c
Christian Brabandt <cb@256bit.org>
parents:
8895
diff
changeset
|
83 call add(x, 'foo') |
36cb3aff8c1c
commit https://github.com/vim/vim/commit/517ffbee0d5b7b46320726faaa330b61f54e867c
Christian Brabandt <cb@256bit.org>
parents:
8895
diff
changeset
|
84 call assert_equal(['foo'], y) |
36cb3aff8c1c
commit https://github.com/vim/vim/commit/517ffbee0d5b7b46320726faaa330b61f54e867c
Christian Brabandt <cb@256bit.org>
parents:
8895
diff
changeset
|
85 endfunc |
9062
0aa90b84118c
commit https://github.com/vim/vim/commit/d8585eded6359f1d7e1981e96ae775efd077c638
Christian Brabandt <cb@256bit.org>
parents:
8939
diff
changeset
|
86 |
0aa90b84118c
commit https://github.com/vim/vim/commit/d8585eded6359f1d7e1981e96ae775efd077c638
Christian Brabandt <cb@256bit.org>
parents:
8939
diff
changeset
|
87 func Test_loop_over_null_list() |
9108
d319453f62b3
commit https://github.com/vim/vim/commit/574860b5ee9da281c875dad07a607454e135eaee
Christian Brabandt <cb@256bit.org>
parents:
9062
diff
changeset
|
88 let null_list = test_null_list() |
9062
0aa90b84118c
commit https://github.com/vim/vim/commit/d8585eded6359f1d7e1981e96ae775efd077c638
Christian Brabandt <cb@256bit.org>
parents:
8939
diff
changeset
|
89 for i in null_list |
0aa90b84118c
commit https://github.com/vim/vim/commit/d8585eded6359f1d7e1981e96ae775efd077c638
Christian Brabandt <cb@256bit.org>
parents:
8939
diff
changeset
|
90 call assert_true(0, 'should not get here') |
0aa90b84118c
commit https://github.com/vim/vim/commit/d8585eded6359f1d7e1981e96ae775efd077c638
Christian Brabandt <cb@256bit.org>
parents:
8939
diff
changeset
|
91 endfor |
0aa90b84118c
commit https://github.com/vim/vim/commit/d8585eded6359f1d7e1981e96ae775efd077c638
Christian Brabandt <cb@256bit.org>
parents:
8939
diff
changeset
|
92 endfunc |
9127
1b41750311b6
commit https://github.com/vim/vim/commit/13ddc5c35921efa69e980284117b6db6465e019c
Christian Brabandt <cb@256bit.org>
parents:
9108
diff
changeset
|
93 |
1b41750311b6
commit https://github.com/vim/vim/commit/13ddc5c35921efa69e980284117b6db6465e019c
Christian Brabandt <cb@256bit.org>
parents:
9108
diff
changeset
|
94 func Test_compare_null_dict() |
1b41750311b6
commit https://github.com/vim/vim/commit/13ddc5c35921efa69e980284117b6db6465e019c
Christian Brabandt <cb@256bit.org>
parents:
9108
diff
changeset
|
95 call assert_fails('let x = test_null_dict()[10]') |
1b41750311b6
commit https://github.com/vim/vim/commit/13ddc5c35921efa69e980284117b6db6465e019c
Christian Brabandt <cb@256bit.org>
parents:
9108
diff
changeset
|
96 call assert_equal({}, {}) |
1b41750311b6
commit https://github.com/vim/vim/commit/13ddc5c35921efa69e980284117b6db6465e019c
Christian Brabandt <cb@256bit.org>
parents:
9108
diff
changeset
|
97 call assert_equal(test_null_dict(), test_null_dict()) |
1b41750311b6
commit https://github.com/vim/vim/commit/13ddc5c35921efa69e980284117b6db6465e019c
Christian Brabandt <cb@256bit.org>
parents:
9108
diff
changeset
|
98 call assert_notequal({}, test_null_dict()) |
1b41750311b6
commit https://github.com/vim/vim/commit/13ddc5c35921efa69e980284117b6db6465e019c
Christian Brabandt <cb@256bit.org>
parents:
9108
diff
changeset
|
99 endfunc |
1b41750311b6
commit https://github.com/vim/vim/commit/13ddc5c35921efa69e980284117b6db6465e019c
Christian Brabandt <cb@256bit.org>
parents:
9108
diff
changeset
|
100 |
1b41750311b6
commit https://github.com/vim/vim/commit/13ddc5c35921efa69e980284117b6db6465e019c
Christian Brabandt <cb@256bit.org>
parents:
9108
diff
changeset
|
101 func Test_set_reg_null_list() |
1b41750311b6
commit https://github.com/vim/vim/commit/13ddc5c35921efa69e980284117b6db6465e019c
Christian Brabandt <cb@256bit.org>
parents:
9108
diff
changeset
|
102 call setreg('x', test_null_list()) |
1b41750311b6
commit https://github.com/vim/vim/commit/13ddc5c35921efa69e980284117b6db6465e019c
Christian Brabandt <cb@256bit.org>
parents:
9108
diff
changeset
|
103 endfunc |
9373
b88c573d8aa4
commit https://github.com/vim/vim/commit/1d90a5a5af84250e226f8a9121e771f7b72aa894
Christian Brabandt <cb@256bit.org>
parents:
9127
diff
changeset
|
104 |
b88c573d8aa4
commit https://github.com/vim/vim/commit/1d90a5a5af84250e226f8a9121e771f7b72aa894
Christian Brabandt <cb@256bit.org>
parents:
9127
diff
changeset
|
105 func Test_special_char() |
b88c573d8aa4
commit https://github.com/vim/vim/commit/1d90a5a5af84250e226f8a9121e771f7b72aa894
Christian Brabandt <cb@256bit.org>
parents:
9127
diff
changeset
|
106 " The failure is only visible using valgrind. |
b88c573d8aa4
commit https://github.com/vim/vim/commit/1d90a5a5af84250e226f8a9121e771f7b72aa894
Christian Brabandt <cb@256bit.org>
parents:
9127
diff
changeset
|
107 call assert_fails('echo "\<C-">') |
b88c573d8aa4
commit https://github.com/vim/vim/commit/1d90a5a5af84250e226f8a9121e771f7b72aa894
Christian Brabandt <cb@256bit.org>
parents:
9127
diff
changeset
|
108 endfunc |
9395
beab399e3883
commit https://github.com/vim/vim/commit/2acfbed9dbea990f129535de7ff3df360365130b
Christian Brabandt <cb@256bit.org>
parents:
9373
diff
changeset
|
109 |
beab399e3883
commit https://github.com/vim/vim/commit/2acfbed9dbea990f129535de7ff3df360365130b
Christian Brabandt <cb@256bit.org>
parents:
9373
diff
changeset
|
110 func Test_option_value() |
beab399e3883
commit https://github.com/vim/vim/commit/2acfbed9dbea990f129535de7ff3df360365130b
Christian Brabandt <cb@256bit.org>
parents:
9373
diff
changeset
|
111 " boolean |
beab399e3883
commit https://github.com/vim/vim/commit/2acfbed9dbea990f129535de7ff3df360365130b
Christian Brabandt <cb@256bit.org>
parents:
9373
diff
changeset
|
112 set bri |
beab399e3883
commit https://github.com/vim/vim/commit/2acfbed9dbea990f129535de7ff3df360365130b
Christian Brabandt <cb@256bit.org>
parents:
9373
diff
changeset
|
113 call assert_equal(1, &bri) |
beab399e3883
commit https://github.com/vim/vim/commit/2acfbed9dbea990f129535de7ff3df360365130b
Christian Brabandt <cb@256bit.org>
parents:
9373
diff
changeset
|
114 set nobri |
beab399e3883
commit https://github.com/vim/vim/commit/2acfbed9dbea990f129535de7ff3df360365130b
Christian Brabandt <cb@256bit.org>
parents:
9373
diff
changeset
|
115 call assert_equal(0, &bri) |
beab399e3883
commit https://github.com/vim/vim/commit/2acfbed9dbea990f129535de7ff3df360365130b
Christian Brabandt <cb@256bit.org>
parents:
9373
diff
changeset
|
116 |
beab399e3883
commit https://github.com/vim/vim/commit/2acfbed9dbea990f129535de7ff3df360365130b
Christian Brabandt <cb@256bit.org>
parents:
9373
diff
changeset
|
117 " number |
beab399e3883
commit https://github.com/vim/vim/commit/2acfbed9dbea990f129535de7ff3df360365130b
Christian Brabandt <cb@256bit.org>
parents:
9373
diff
changeset
|
118 set ts=1 |
beab399e3883
commit https://github.com/vim/vim/commit/2acfbed9dbea990f129535de7ff3df360365130b
Christian Brabandt <cb@256bit.org>
parents:
9373
diff
changeset
|
119 call assert_equal(1, &ts) |
beab399e3883
commit https://github.com/vim/vim/commit/2acfbed9dbea990f129535de7ff3df360365130b
Christian Brabandt <cb@256bit.org>
parents:
9373
diff
changeset
|
120 set ts=8 |
beab399e3883
commit https://github.com/vim/vim/commit/2acfbed9dbea990f129535de7ff3df360365130b
Christian Brabandt <cb@256bit.org>
parents:
9373
diff
changeset
|
121 call assert_equal(8, &ts) |
beab399e3883
commit https://github.com/vim/vim/commit/2acfbed9dbea990f129535de7ff3df360365130b
Christian Brabandt <cb@256bit.org>
parents:
9373
diff
changeset
|
122 |
beab399e3883
commit https://github.com/vim/vim/commit/2acfbed9dbea990f129535de7ff3df360365130b
Christian Brabandt <cb@256bit.org>
parents:
9373
diff
changeset
|
123 " string |
beab399e3883
commit https://github.com/vim/vim/commit/2acfbed9dbea990f129535de7ff3df360365130b
Christian Brabandt <cb@256bit.org>
parents:
9373
diff
changeset
|
124 exe "set cedit=\<Esc>" |
beab399e3883
commit https://github.com/vim/vim/commit/2acfbed9dbea990f129535de7ff3df360365130b
Christian Brabandt <cb@256bit.org>
parents:
9373
diff
changeset
|
125 call assert_equal("\<Esc>", &cedit) |
beab399e3883
commit https://github.com/vim/vim/commit/2acfbed9dbea990f129535de7ff3df360365130b
Christian Brabandt <cb@256bit.org>
parents:
9373
diff
changeset
|
126 set cpo= |
beab399e3883
commit https://github.com/vim/vim/commit/2acfbed9dbea990f129535de7ff3df360365130b
Christian Brabandt <cb@256bit.org>
parents:
9373
diff
changeset
|
127 call assert_equal("", &cpo) |
beab399e3883
commit https://github.com/vim/vim/commit/2acfbed9dbea990f129535de7ff3df360365130b
Christian Brabandt <cb@256bit.org>
parents:
9373
diff
changeset
|
128 set cpo=abcdefgi |
beab399e3883
commit https://github.com/vim/vim/commit/2acfbed9dbea990f129535de7ff3df360365130b
Christian Brabandt <cb@256bit.org>
parents:
9373
diff
changeset
|
129 call assert_equal("abcdefgi", &cpo) |
beab399e3883
commit https://github.com/vim/vim/commit/2acfbed9dbea990f129535de7ff3df360365130b
Christian Brabandt <cb@256bit.org>
parents:
9373
diff
changeset
|
130 set cpo&vim |
beab399e3883
commit https://github.com/vim/vim/commit/2acfbed9dbea990f129535de7ff3df360365130b
Christian Brabandt <cb@256bit.org>
parents:
9373
diff
changeset
|
131 endfunc |
9497
d18d71ae21e5
commit https://github.com/vim/vim/commit/38ee6b041e73ad31c3b6b99d56d20833b59b2b57
Christian Brabandt <cb@256bit.org>
parents:
9395
diff
changeset
|
132 |
d18d71ae21e5
commit https://github.com/vim/vim/commit/38ee6b041e73ad31c3b6b99d56d20833b59b2b57
Christian Brabandt <cb@256bit.org>
parents:
9395
diff
changeset
|
133 function Test_printf_64bit() |
d18d71ae21e5
commit https://github.com/vim/vim/commit/38ee6b041e73ad31c3b6b99d56d20833b59b2b57
Christian Brabandt <cb@256bit.org>
parents:
9395
diff
changeset
|
134 if has('num64') |
d18d71ae21e5
commit https://github.com/vim/vim/commit/38ee6b041e73ad31c3b6b99d56d20833b59b2b57
Christian Brabandt <cb@256bit.org>
parents:
9395
diff
changeset
|
135 call assert_equal("123456789012345", printf('%d', 123456789012345)) |
d18d71ae21e5
commit https://github.com/vim/vim/commit/38ee6b041e73ad31c3b6b99d56d20833b59b2b57
Christian Brabandt <cb@256bit.org>
parents:
9395
diff
changeset
|
136 endif |
d18d71ae21e5
commit https://github.com/vim/vim/commit/38ee6b041e73ad31c3b6b99d56d20833b59b2b57
Christian Brabandt <cb@256bit.org>
parents:
9395
diff
changeset
|
137 endfunc |