annotate src/testdir/test63.in @ 7626:5d57c7117629

Added tag v7.4.1112 for changeset b4384c581806ae3ce822f4bb0639c3a6d382784b
author Christian Brabandt <cb@256bit.org>
date Sat, 16 Jan 2016 23:00:05 +0100
parents f4e5704c5c43
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
1326
22886f3d882d updated for version 7.1-040
vimboss
parents: 1325
diff changeset
1 Test for ":match", ":2match", ":3match", "clearmatches()", "getmatches()",
5979
f9fa2e506b9f updated for version 7.4.330
Bram Moolenaar <bram@vim.org>
parents: 1405
diff changeset
2 "matchadd()", "matchaddpos", "matcharg()", "matchdelete()", and "setmatches()".
1326
22886f3d882d updated for version 7.1-040
vimboss
parents: 1325
diff changeset
3
22886f3d882d updated for version 7.1-040
vimboss
parents: 1325
diff changeset
4 STARTTEST
22886f3d882d updated for version 7.1-040
vimboss
parents: 1325
diff changeset
5 :so small.vim
6134
4c25af735304 updated for version 7.4.405
Bram Moolenaar <bram@vim.org>
parents: 6073
diff changeset
6 :set encoding=utf8
1326
22886f3d882d updated for version 7.1-040
vimboss
parents: 1325
diff changeset
7 :" --- Check that "matcharg()" returns the correct group and pattern if a match
22886f3d882d updated for version 7.1-040
vimboss
parents: 1325
diff changeset
8 :" --- is defined.
22886f3d882d updated for version 7.1-040
vimboss
parents: 1325
diff changeset
9 :let @r = "*** Test 1: "
6411
d51d47bd77c2 updated for version 7.4.536
Bram Moolenaar <bram@vim.org>
parents: 6134
diff changeset
10 :highlight MyGroup1 term=bold ctermbg=red guibg=red
d51d47bd77c2 updated for version 7.4.536
Bram Moolenaar <bram@vim.org>
parents: 6134
diff changeset
11 :highlight MyGroup2 term=italic ctermbg=green guibg=green
d51d47bd77c2 updated for version 7.4.536
Bram Moolenaar <bram@vim.org>
parents: 6134
diff changeset
12 :highlight MyGroup3 term=underline ctermbg=blue guibg=blue
1326
22886f3d882d updated for version 7.1-040
vimboss
parents: 1325
diff changeset
13 :match MyGroup1 /TODO/
22886f3d882d updated for version 7.1-040
vimboss
parents: 1325
diff changeset
14 :2match MyGroup2 /FIXME/
22886f3d882d updated for version 7.1-040
vimboss
parents: 1325
diff changeset
15 :3match MyGroup3 /XXX/
22886f3d882d updated for version 7.1-040
vimboss
parents: 1325
diff changeset
16 :if matcharg(1) == ['MyGroup1', 'TODO'] && matcharg(2) == ['MyGroup2', 'FIXME'] && matcharg(3) == ['MyGroup3', 'XXX']
22886f3d882d updated for version 7.1-040
vimboss
parents: 1325
diff changeset
17 : let @r .= "OK\n"
22886f3d882d updated for version 7.1-040
vimboss
parents: 1325
diff changeset
18 :else
22886f3d882d updated for version 7.1-040
vimboss
parents: 1325
diff changeset
19 : let @r .= "FAILED\n"
22886f3d882d updated for version 7.1-040
vimboss
parents: 1325
diff changeset
20 :endif
22886f3d882d updated for version 7.1-040
vimboss
parents: 1325
diff changeset
21 :" --- Check that "matcharg()" returns an empty list if the argument is not 1,
22886f3d882d updated for version 7.1-040
vimboss
parents: 1325
diff changeset
22 :" --- 2 or 3 (only 0 and 4 are tested).
22886f3d882d updated for version 7.1-040
vimboss
parents: 1325
diff changeset
23 :let @r .= "*** Test 2: "
22886f3d882d updated for version 7.1-040
vimboss
parents: 1325
diff changeset
24 :if matcharg(0) == [] && matcharg(4) == []
22886f3d882d updated for version 7.1-040
vimboss
parents: 1325
diff changeset
25 : let @r .= "OK\n"
22886f3d882d updated for version 7.1-040
vimboss
parents: 1325
diff changeset
26 :else
22886f3d882d updated for version 7.1-040
vimboss
parents: 1325
diff changeset
27 : let @r .= "FAILED\n"
22886f3d882d updated for version 7.1-040
vimboss
parents: 1325
diff changeset
28 :endif
22886f3d882d updated for version 7.1-040
vimboss
parents: 1325
diff changeset
29 :" --- Check that "matcharg()" returns ['', ''] if a match is not defined.
22886f3d882d updated for version 7.1-040
vimboss
parents: 1325
diff changeset
30 :let @r .= "*** Test 3: "
22886f3d882d updated for version 7.1-040
vimboss
parents: 1325
diff changeset
31 :match
22886f3d882d updated for version 7.1-040
vimboss
parents: 1325
diff changeset
32 :2match
22886f3d882d updated for version 7.1-040
vimboss
parents: 1325
diff changeset
33 :3match
22886f3d882d updated for version 7.1-040
vimboss
parents: 1325
diff changeset
34 :if matcharg(1) == ['', ''] && matcharg(2) == ['', ''] && matcharg(3) == ['', '']
22886f3d882d updated for version 7.1-040
vimboss
parents: 1325
diff changeset
35 : let @r .= "OK\n"
22886f3d882d updated for version 7.1-040
vimboss
parents: 1325
diff changeset
36 :else
22886f3d882d updated for version 7.1-040
vimboss
parents: 1325
diff changeset
37 : let @r .= "FAILED\n"
22886f3d882d updated for version 7.1-040
vimboss
parents: 1325
diff changeset
38 :endif
22886f3d882d updated for version 7.1-040
vimboss
parents: 1325
diff changeset
39 :" --- Check that "matchadd()" and "getmatches()" agree on added matches and
22886f3d882d updated for version 7.1-040
vimboss
parents: 1325
diff changeset
40 :" --- that default values apply.
22886f3d882d updated for version 7.1-040
vimboss
parents: 1325
diff changeset
41 :let @r .= "*** Test 4: "
22886f3d882d updated for version 7.1-040
vimboss
parents: 1325
diff changeset
42 :let m1 = matchadd("MyGroup1", "TODO")
22886f3d882d updated for version 7.1-040
vimboss
parents: 1325
diff changeset
43 :let m2 = matchadd("MyGroup2", "FIXME", 42)
22886f3d882d updated for version 7.1-040
vimboss
parents: 1325
diff changeset
44 :let m3 = matchadd("MyGroup3", "XXX", 60, 17)
22886f3d882d updated for version 7.1-040
vimboss
parents: 1325
diff changeset
45 :if getmatches() == [{'group': 'MyGroup1', 'pattern': 'TODO', 'priority': 10, 'id': 4}, {'group': 'MyGroup2', 'pattern': 'FIXME', 'priority': 42, 'id': 5}, {'group': 'MyGroup3', 'pattern': 'XXX', 'priority': 60, 'id': 17}]
22886f3d882d updated for version 7.1-040
vimboss
parents: 1325
diff changeset
46 : let @r .= "OK\n"
22886f3d882d updated for version 7.1-040
vimboss
parents: 1325
diff changeset
47 :else
22886f3d882d updated for version 7.1-040
vimboss
parents: 1325
diff changeset
48 : let @r .= "FAILED\n"
22886f3d882d updated for version 7.1-040
vimboss
parents: 1325
diff changeset
49 :endif
22886f3d882d updated for version 7.1-040
vimboss
parents: 1325
diff changeset
50 :" --- Check that "matchdelete()" deletes the matches defined in the previous
22886f3d882d updated for version 7.1-040
vimboss
parents: 1325
diff changeset
51 :" --- test correctly.
22886f3d882d updated for version 7.1-040
vimboss
parents: 1325
diff changeset
52 :let @r .= "*** Test 5: "
22886f3d882d updated for version 7.1-040
vimboss
parents: 1325
diff changeset
53 :call matchdelete(m1)
22886f3d882d updated for version 7.1-040
vimboss
parents: 1325
diff changeset
54 :call matchdelete(m2)
22886f3d882d updated for version 7.1-040
vimboss
parents: 1325
diff changeset
55 :call matchdelete(m3)
22886f3d882d updated for version 7.1-040
vimboss
parents: 1325
diff changeset
56 :unlet m1
22886f3d882d updated for version 7.1-040
vimboss
parents: 1325
diff changeset
57 :unlet m2
22886f3d882d updated for version 7.1-040
vimboss
parents: 1325
diff changeset
58 :unlet m3
22886f3d882d updated for version 7.1-040
vimboss
parents: 1325
diff changeset
59 :if getmatches() == []
22886f3d882d updated for version 7.1-040
vimboss
parents: 1325
diff changeset
60 : let @r .= "OK\n"
22886f3d882d updated for version 7.1-040
vimboss
parents: 1325
diff changeset
61 :else
22886f3d882d updated for version 7.1-040
vimboss
parents: 1325
diff changeset
62 : let @r .= "FAILED\n"
22886f3d882d updated for version 7.1-040
vimboss
parents: 1325
diff changeset
63 :endif
1405
b63792dadc23 updated for version 7.1-120
vimboss
parents: 1326
diff changeset
64 :" --- Check that "matchdelete()" returns 0 if successful and otherwise -1.
1326
22886f3d882d updated for version 7.1-040
vimboss
parents: 1325
diff changeset
65 :let @r .= "*** Test 6: "
22886f3d882d updated for version 7.1-040
vimboss
parents: 1325
diff changeset
66 :let m = matchadd("MyGroup1", "TODO")
22886f3d882d updated for version 7.1-040
vimboss
parents: 1325
diff changeset
67 :let r1 = matchdelete(m)
22886f3d882d updated for version 7.1-040
vimboss
parents: 1325
diff changeset
68 :let r2 = matchdelete(42)
22886f3d882d updated for version 7.1-040
vimboss
parents: 1325
diff changeset
69 :if r1 == 0 && r2 == -1
22886f3d882d updated for version 7.1-040
vimboss
parents: 1325
diff changeset
70 : let @r .= "OK\n"
22886f3d882d updated for version 7.1-040
vimboss
parents: 1325
diff changeset
71 :else
22886f3d882d updated for version 7.1-040
vimboss
parents: 1325
diff changeset
72 : let @r .= "FAILED\n"
22886f3d882d updated for version 7.1-040
vimboss
parents: 1325
diff changeset
73 :endif
22886f3d882d updated for version 7.1-040
vimboss
parents: 1325
diff changeset
74 :unlet m
22886f3d882d updated for version 7.1-040
vimboss
parents: 1325
diff changeset
75 :unlet r1
22886f3d882d updated for version 7.1-040
vimboss
parents: 1325
diff changeset
76 :unlet r2
22886f3d882d updated for version 7.1-040
vimboss
parents: 1325
diff changeset
77 :" --- Check that "clearmatches()" clears all matches defined by ":match" and
22886f3d882d updated for version 7.1-040
vimboss
parents: 1325
diff changeset
78 :" --- "matchadd()".
22886f3d882d updated for version 7.1-040
vimboss
parents: 1325
diff changeset
79 :let @r .= "*** Test 7: "
22886f3d882d updated for version 7.1-040
vimboss
parents: 1325
diff changeset
80 :let m1 = matchadd("MyGroup1", "TODO")
22886f3d882d updated for version 7.1-040
vimboss
parents: 1325
diff changeset
81 :let m2 = matchadd("MyGroup2", "FIXME", 42)
22886f3d882d updated for version 7.1-040
vimboss
parents: 1325
diff changeset
82 :let m3 = matchadd("MyGroup3", "XXX", 60, 17)
22886f3d882d updated for version 7.1-040
vimboss
parents: 1325
diff changeset
83 :match MyGroup1 /COFFEE/
22886f3d882d updated for version 7.1-040
vimboss
parents: 1325
diff changeset
84 :2match MyGroup2 /HUMPPA/
22886f3d882d updated for version 7.1-040
vimboss
parents: 1325
diff changeset
85 :3match MyGroup3 /VIM/
22886f3d882d updated for version 7.1-040
vimboss
parents: 1325
diff changeset
86 :call clearmatches()
22886f3d882d updated for version 7.1-040
vimboss
parents: 1325
diff changeset
87 :if getmatches() == []
22886f3d882d updated for version 7.1-040
vimboss
parents: 1325
diff changeset
88 : let @r .= "OK\n"
22886f3d882d updated for version 7.1-040
vimboss
parents: 1325
diff changeset
89 :else
22886f3d882d updated for version 7.1-040
vimboss
parents: 1325
diff changeset
90 : let @r .= "FAILED\n"
22886f3d882d updated for version 7.1-040
vimboss
parents: 1325
diff changeset
91 :endif
22886f3d882d updated for version 7.1-040
vimboss
parents: 1325
diff changeset
92 :unlet m1
22886f3d882d updated for version 7.1-040
vimboss
parents: 1325
diff changeset
93 :unlet m2
22886f3d882d updated for version 7.1-040
vimboss
parents: 1325
diff changeset
94 :unlet m3
22886f3d882d updated for version 7.1-040
vimboss
parents: 1325
diff changeset
95 :" --- Check that "setmatches()" restores a list of matches saved by
22886f3d882d updated for version 7.1-040
vimboss
parents: 1325
diff changeset
96 :" --- "getmatches()" without changes. (Matches with equal priority must also
22886f3d882d updated for version 7.1-040
vimboss
parents: 1325
diff changeset
97 :" --- remain in the same order.)
22886f3d882d updated for version 7.1-040
vimboss
parents: 1325
diff changeset
98 :let @r .= "*** Test 8: "
22886f3d882d updated for version 7.1-040
vimboss
parents: 1325
diff changeset
99 :let m1 = matchadd("MyGroup1", "TODO")
22886f3d882d updated for version 7.1-040
vimboss
parents: 1325
diff changeset
100 :let m2 = matchadd("MyGroup2", "FIXME", 42)
22886f3d882d updated for version 7.1-040
vimboss
parents: 1325
diff changeset
101 :let m3 = matchadd("MyGroup3", "XXX", 60, 17)
22886f3d882d updated for version 7.1-040
vimboss
parents: 1325
diff changeset
102 :match MyGroup1 /COFFEE/
22886f3d882d updated for version 7.1-040
vimboss
parents: 1325
diff changeset
103 :2match MyGroup2 /HUMPPA/
22886f3d882d updated for version 7.1-040
vimboss
parents: 1325
diff changeset
104 :3match MyGroup3 /VIM/
22886f3d882d updated for version 7.1-040
vimboss
parents: 1325
diff changeset
105 :let ml = getmatches()
22886f3d882d updated for version 7.1-040
vimboss
parents: 1325
diff changeset
106 :call clearmatches()
22886f3d882d updated for version 7.1-040
vimboss
parents: 1325
diff changeset
107 :call setmatches(ml)
22886f3d882d updated for version 7.1-040
vimboss
parents: 1325
diff changeset
108 :if getmatches() == ml
22886f3d882d updated for version 7.1-040
vimboss
parents: 1325
diff changeset
109 : let @r .= "OK\n"
22886f3d882d updated for version 7.1-040
vimboss
parents: 1325
diff changeset
110 :else
22886f3d882d updated for version 7.1-040
vimboss
parents: 1325
diff changeset
111 : let @r .= "FAILED\n"
22886f3d882d updated for version 7.1-040
vimboss
parents: 1325
diff changeset
112 :endif
22886f3d882d updated for version 7.1-040
vimboss
parents: 1325
diff changeset
113 :call clearmatches()
22886f3d882d updated for version 7.1-040
vimboss
parents: 1325
diff changeset
114 :unlet m1
22886f3d882d updated for version 7.1-040
vimboss
parents: 1325
diff changeset
115 :unlet m2
22886f3d882d updated for version 7.1-040
vimboss
parents: 1325
diff changeset
116 :unlet m3
22886f3d882d updated for version 7.1-040
vimboss
parents: 1325
diff changeset
117 :unlet ml
22886f3d882d updated for version 7.1-040
vimboss
parents: 1325
diff changeset
118 :" --- Check that "setmatches()" will not add two matches with the same ID. The
22886f3d882d updated for version 7.1-040
vimboss
parents: 1325
diff changeset
119 :" --- expected behaviour (for now) is to add the first match but not the
22886f3d882d updated for version 7.1-040
vimboss
parents: 1325
diff changeset
120 :" --- second and to return 0 (even though it is a matter of debate whether
1405
b63792dadc23 updated for version 7.1-120
vimboss
parents: 1326
diff changeset
121 :" --- this can be considered successful behaviour).
1326
22886f3d882d updated for version 7.1-040
vimboss
parents: 1325
diff changeset
122 :let @r .= "*** Test 9: "
22886f3d882d updated for version 7.1-040
vimboss
parents: 1325
diff changeset
123 :let r1 = setmatches([{'group': 'MyGroup1', 'pattern': 'TODO', 'priority': 10, 'id': 1}, {'group': 'MyGroup2', 'pattern': 'FIXME', 'priority': 10, 'id': 1}])
22886f3d882d updated for version 7.1-040
vimboss
parents: 1325
diff changeset
124 :if getmatches() == [{'group': 'MyGroup1', 'pattern': 'TODO', 'priority': 10, 'id': 1}] && r1 == 0
22886f3d882d updated for version 7.1-040
vimboss
parents: 1325
diff changeset
125 : let @r .= "OK\n"
22886f3d882d updated for version 7.1-040
vimboss
parents: 1325
diff changeset
126 :else
22886f3d882d updated for version 7.1-040
vimboss
parents: 1325
diff changeset
127 : let @r .= "FAILED\n"
22886f3d882d updated for version 7.1-040
vimboss
parents: 1325
diff changeset
128 :endif
22886f3d882d updated for version 7.1-040
vimboss
parents: 1325
diff changeset
129 :call clearmatches()
22886f3d882d updated for version 7.1-040
vimboss
parents: 1325
diff changeset
130 :unlet r1
1405
b63792dadc23 updated for version 7.1-120
vimboss
parents: 1326
diff changeset
131 :" --- Check that "setmatches()" returns 0 if successful and otherwise -1.
1326
22886f3d882d updated for version 7.1-040
vimboss
parents: 1325
diff changeset
132 :" --- (A range of valid and invalid input values are tried out to generate the
22886f3d882d updated for version 7.1-040
vimboss
parents: 1325
diff changeset
133 :" --- return values.)
22886f3d882d updated for version 7.1-040
vimboss
parents: 1325
diff changeset
134 :let @r .= "*** Test 10: "
22886f3d882d updated for version 7.1-040
vimboss
parents: 1325
diff changeset
135 :let rs1 = setmatches([])
22886f3d882d updated for version 7.1-040
vimboss
parents: 1325
diff changeset
136 :let rs2 = setmatches([{'group': 'MyGroup1', 'pattern': 'TODO', 'priority': 10, 'id': 1}])
22886f3d882d updated for version 7.1-040
vimboss
parents: 1325
diff changeset
137 :call clearmatches()
22886f3d882d updated for version 7.1-040
vimboss
parents: 1325
diff changeset
138 :let rf1 = setmatches(0)
22886f3d882d updated for version 7.1-040
vimboss
parents: 1325
diff changeset
139 :let rf2 = setmatches([0])
22886f3d882d updated for version 7.1-040
vimboss
parents: 1325
diff changeset
140 :let rf3 = setmatches([{'wrong key': 'wrong value'}])
22886f3d882d updated for version 7.1-040
vimboss
parents: 1325
diff changeset
141 :if rs1 == 0 && rs2 == 0 && rf1 == -1 && rf2 == -1 && rf3 == -1
22886f3d882d updated for version 7.1-040
vimboss
parents: 1325
diff changeset
142 : let @r .= "OK\n"
22886f3d882d updated for version 7.1-040
vimboss
parents: 1325
diff changeset
143 :else
22886f3d882d updated for version 7.1-040
vimboss
parents: 1325
diff changeset
144 : let @r .= "FAILED\n"
22886f3d882d updated for version 7.1-040
vimboss
parents: 1325
diff changeset
145 :endif
22886f3d882d updated for version 7.1-040
vimboss
parents: 1325
diff changeset
146 :unlet rs1
22886f3d882d updated for version 7.1-040
vimboss
parents: 1325
diff changeset
147 :unlet rs2
22886f3d882d updated for version 7.1-040
vimboss
parents: 1325
diff changeset
148 :unlet rf1
22886f3d882d updated for version 7.1-040
vimboss
parents: 1325
diff changeset
149 :unlet rf2
22886f3d882d updated for version 7.1-040
vimboss
parents: 1325
diff changeset
150 :unlet rf3
5979
f9fa2e506b9f updated for version 7.4.330
Bram Moolenaar <bram@vim.org>
parents: 1405
diff changeset
151 :" --- Check that "matchaddpos()" positions matches correctly
f9fa2e506b9f updated for version 7.4.330
Bram Moolenaar <bram@vim.org>
parents: 1405
diff changeset
152 :let @r .= "*** Test 11:\n"
f9fa2e506b9f updated for version 7.4.330
Bram Moolenaar <bram@vim.org>
parents: 1405
diff changeset
153 :set nolazyredraw
f9fa2e506b9f updated for version 7.4.330
Bram Moolenaar <bram@vim.org>
parents: 1405
diff changeset
154 :call setline(1, 'abcdefghijklmnopq')
f9fa2e506b9f updated for version 7.4.330
Bram Moolenaar <bram@vim.org>
parents: 1405
diff changeset
155 :call matchaddpos("MyGroup1", [[1, 5], [1, 8, 3]], 10, 3)
f9fa2e506b9f updated for version 7.4.330
Bram Moolenaar <bram@vim.org>
parents: 1405
diff changeset
156 :1
f9fa2e506b9f updated for version 7.4.330
Bram Moolenaar <bram@vim.org>
parents: 1405
diff changeset
157 :redraw!
f9fa2e506b9f updated for version 7.4.330
Bram Moolenaar <bram@vim.org>
parents: 1405
diff changeset
158 :let v1 = screenattr(1, 1)
f9fa2e506b9f updated for version 7.4.330
Bram Moolenaar <bram@vim.org>
parents: 1405
diff changeset
159 :let v5 = screenattr(1, 5)
f9fa2e506b9f updated for version 7.4.330
Bram Moolenaar <bram@vim.org>
parents: 1405
diff changeset
160 :let v6 = screenattr(1, 6)
f9fa2e506b9f updated for version 7.4.330
Bram Moolenaar <bram@vim.org>
parents: 1405
diff changeset
161 :let v8 = screenattr(1, 8)
f9fa2e506b9f updated for version 7.4.330
Bram Moolenaar <bram@vim.org>
parents: 1405
diff changeset
162 :let v10 = screenattr(1, 10)
f9fa2e506b9f updated for version 7.4.330
Bram Moolenaar <bram@vim.org>
parents: 1405
diff changeset
163 :let v11 = screenattr(1, 11)
f9fa2e506b9f updated for version 7.4.330
Bram Moolenaar <bram@vim.org>
parents: 1405
diff changeset
164 :let @r .= string(getmatches())."\n"
f9fa2e506b9f updated for version 7.4.330
Bram Moolenaar <bram@vim.org>
parents: 1405
diff changeset
165 :if v1 != v5 && v6 == v1 && v8 == v5 && v10 == v5 && v11 == v1
f9fa2e506b9f updated for version 7.4.330
Bram Moolenaar <bram@vim.org>
parents: 1405
diff changeset
166 : let @r .= "OK\n"
f9fa2e506b9f updated for version 7.4.330
Bram Moolenaar <bram@vim.org>
parents: 1405
diff changeset
167 :else
6134
4c25af735304 updated for version 7.4.405
Bram Moolenaar <bram@vim.org>
parents: 6073
diff changeset
168 : let @r .= "FAILED: " . v5 . "/" . v6 . "/" . v8 . "/" . v10 . "/" . v11 . "\n"
4c25af735304 updated for version 7.4.405
Bram Moolenaar <bram@vim.org>
parents: 6073
diff changeset
169 :endif
4c25af735304 updated for version 7.4.405
Bram Moolenaar <bram@vim.org>
parents: 6073
diff changeset
170 :call clearmatches()
4c25af735304 updated for version 7.4.405
Bram Moolenaar <bram@vim.org>
parents: 6073
diff changeset
171 :"
4c25af735304 updated for version 7.4.405
Bram Moolenaar <bram@vim.org>
parents: 6073
diff changeset
172 :call setline(1, 'abcdΣabcdef')
4c25af735304 updated for version 7.4.405
Bram Moolenaar <bram@vim.org>
parents: 6073
diff changeset
173 :call matchaddpos("MyGroup1", [[1, 4, 2], [1, 9, 2]])
4c25af735304 updated for version 7.4.405
Bram Moolenaar <bram@vim.org>
parents: 6073
diff changeset
174 :1
4c25af735304 updated for version 7.4.405
Bram Moolenaar <bram@vim.org>
parents: 6073
diff changeset
175 :redraw!
4c25af735304 updated for version 7.4.405
Bram Moolenaar <bram@vim.org>
parents: 6073
diff changeset
176 :let v1 = screenattr(1, 1)
4c25af735304 updated for version 7.4.405
Bram Moolenaar <bram@vim.org>
parents: 6073
diff changeset
177 :let v4 = screenattr(1, 4)
4c25af735304 updated for version 7.4.405
Bram Moolenaar <bram@vim.org>
parents: 6073
diff changeset
178 :let v5 = screenattr(1, 5)
4c25af735304 updated for version 7.4.405
Bram Moolenaar <bram@vim.org>
parents: 6073
diff changeset
179 :let v6 = screenattr(1, 6)
4c25af735304 updated for version 7.4.405
Bram Moolenaar <bram@vim.org>
parents: 6073
diff changeset
180 :let v7 = screenattr(1, 7)
4c25af735304 updated for version 7.4.405
Bram Moolenaar <bram@vim.org>
parents: 6073
diff changeset
181 :let v8 = screenattr(1, 8)
4c25af735304 updated for version 7.4.405
Bram Moolenaar <bram@vim.org>
parents: 6073
diff changeset
182 :let v9 = screenattr(1, 9)
4c25af735304 updated for version 7.4.405
Bram Moolenaar <bram@vim.org>
parents: 6073
diff changeset
183 :let v10 = screenattr(1, 10)
4c25af735304 updated for version 7.4.405
Bram Moolenaar <bram@vim.org>
parents: 6073
diff changeset
184 :let @r .= string(getmatches())."\n"
4c25af735304 updated for version 7.4.405
Bram Moolenaar <bram@vim.org>
parents: 6073
diff changeset
185 :if v1 != v4 && v5 == v4 && v6 == v1 && v7 == v1 && v8 == v4 && v9 == v4 && v10 == v1
4c25af735304 updated for version 7.4.405
Bram Moolenaar <bram@vim.org>
parents: 6073
diff changeset
186 : let @r .= "OK\n"
4c25af735304 updated for version 7.4.405
Bram Moolenaar <bram@vim.org>
parents: 6073
diff changeset
187 :else
4c25af735304 updated for version 7.4.405
Bram Moolenaar <bram@vim.org>
parents: 6073
diff changeset
188 : let @r .= "FAILED: " . v4 . "/" . v5 . "/" . v6 . "/" . v7 . "/" . v8 . "/" . v9 . "/" . v10 . "\n"
5979
f9fa2e506b9f updated for version 7.4.330
Bram Moolenaar <bram@vim.org>
parents: 1405
diff changeset
189 :endif
6849
f4e5704c5c43 patch 7.4.745
Bram Moolenaar <bram@vim.org>
parents: 6411
diff changeset
190 :" Check, that setmatches() can correctly restore the matches from matchaddpos()
f4e5704c5c43 patch 7.4.745
Bram Moolenaar <bram@vim.org>
parents: 6411
diff changeset
191 :call matchadd('MyGroup1', '\%2lmatchadd')
f4e5704c5c43 patch 7.4.745
Bram Moolenaar <bram@vim.org>
parents: 6411
diff changeset
192 :let m=getmatches()
5979
f9fa2e506b9f updated for version 7.4.330
Bram Moolenaar <bram@vim.org>
parents: 1405
diff changeset
193 :call clearmatches()
6849
f4e5704c5c43 patch 7.4.745
Bram Moolenaar <bram@vim.org>
parents: 6411
diff changeset
194 :call setmatches(m)
f4e5704c5c43 patch 7.4.745
Bram Moolenaar <bram@vim.org>
parents: 6411
diff changeset
195 :let @r .= string(getmatches())."\n"
1326
22886f3d882d updated for version 7.1-040
vimboss
parents: 1325
diff changeset
196 G"rp
22886f3d882d updated for version 7.1-040
vimboss
parents: 1325
diff changeset
197 :/^Results/,$wq! test.out
22886f3d882d updated for version 7.1-040
vimboss
parents: 1325
diff changeset
198 ENDTEST
22886f3d882d updated for version 7.1-040
vimboss
parents: 1325
diff changeset
199
22886f3d882d updated for version 7.1-040
vimboss
parents: 1325
diff changeset
200 Results of test63: