comparison src/testdir/test_match.vim @ 15607:2dcaa860e3fc v8.1.0811

patch 8.1.0811: too many #ifdefs commit https://github.com/vim/vim/commit/30276f2beb248557c6b33cd5418bca8b7084b0a5 Author: Bram Moolenaar <Bram@vim.org> Date: Thu Jan 24 17:59:39 2019 +0100 patch 8.1.0811: too many #ifdefs Problem: Too many #ifdefs. Solution: Graduate FEAT_MBYTE, the final chapter.
author Bram Moolenaar <Bram@vim.org>
date Thu, 24 Jan 2019 18:00:07 +0100
parents 631344964949
children aef0f93d3eba
comparison
equal deleted inserted replaced
15606:50e09796a00a 15607:2dcaa860e3fc
112 call assert_equal(v10, v5) 112 call assert_equal(v10, v5)
113 call assert_equal(v11, v1) 113 call assert_equal(v11, v1)
114 call assert_equal([{'group': 'MyGroup1', 'id': 3, 'priority': 10, 'pos1': [1, 5, 1], 'pos2': [1, 8, 3]}], getmatches()) 114 call assert_equal([{'group': 'MyGroup1', 'id': 3, 'priority': 10, 'pos1': [1, 5, 1], 'pos2': [1, 8, 3]}], getmatches())
115 call clearmatches() 115 call clearmatches()
116 116
117 " 117 call setline(1, 'abcdΣabcdef')
118 if has('multi_byte') 118 call matchaddpos("MyGroup1", [[1, 4, 2], [1, 9, 2]])
119 call setline(1, 'abcdΣabcdef') 119 1
120 call matchaddpos("MyGroup1", [[1, 4, 2], [1, 9, 2]]) 120 redraw!
121 1 121 let v1 = screenattr(1, 1)
122 redraw! 122 let v4 = screenattr(1, 4)
123 let v1 = screenattr(1, 1) 123 let v5 = screenattr(1, 5)
124 let v4 = screenattr(1, 4) 124 let v6 = screenattr(1, 6)
125 let v5 = screenattr(1, 5) 125 let v7 = screenattr(1, 7)
126 let v6 = screenattr(1, 6) 126 let v8 = screenattr(1, 8)
127 let v7 = screenattr(1, 7) 127 let v9 = screenattr(1, 9)
128 let v8 = screenattr(1, 8) 128 let v10 = screenattr(1, 10)
129 let v9 = screenattr(1, 9) 129 call assert_equal([{'group': 'MyGroup1', 'id': 11, 'priority': 10, 'pos1': [1, 4, 2], 'pos2': [1, 9, 2]}], getmatches())
130 let v10 = screenattr(1, 10) 130 call assert_notequal(v1, v4)
131 call assert_equal([{'group': 'MyGroup1', 'id': 11, 'priority': 10, 'pos1': [1, 4, 2], 'pos2': [1, 9, 2]}], getmatches()) 131 call assert_equal(v5, v4)
132 call assert_notequal(v1, v4) 132 call assert_equal(v6, v1)
133 call assert_equal(v5, v4) 133 call assert_equal(v7, v1)
134 call assert_equal(v6, v1) 134 call assert_equal(v8, v4)
135 call assert_equal(v7, v1) 135 call assert_equal(v9, v4)
136 call assert_equal(v8, v4) 136 call assert_equal(v10, v1)
137 call assert_equal(v9, v4) 137
138 call assert_equal(v10, v1) 138 " Check, that setmatches() can correctly restore the matches from matchaddpos()
139 139 call matchadd('MyGroup1', '\%2lmatchadd')
140 " Check, that setmatches() can correctly restore the matches from matchaddpos() 140 let m=getmatches()
141 call matchadd('MyGroup1', '\%2lmatchadd') 141 call clearmatches()
142 let m=getmatches() 142 call setmatches(m)
143 call clearmatches() 143 call assert_equal([{'group': 'MyGroup1', 'id': 11, 'priority': 10, 'pos1': [1, 4, 2], 'pos2': [1,9, 2]}, {'group': 'MyGroup1', 'pattern': '\%2lmatchadd', 'priority': 10, 'id': 12}], getmatches())
144 call setmatches(m)
145 call assert_equal([{'group': 'MyGroup1', 'id': 11, 'priority': 10, 'pos1': [1, 4, 2], 'pos2': [1,9, 2]}, {'group': 'MyGroup1', 'pattern': '\%2lmatchadd', 'priority': 10, 'id': 12}], getmatches())
146 endif
147 144
148 highlight MyGroup1 NONE 145 highlight MyGroup1 NONE
149 highlight MyGroup2 NONE 146 highlight MyGroup2 NONE
150 highlight MyGroup3 NONE 147 highlight MyGroup3 NONE
151 endfunc 148 endfunc