Mercurial > vim
comparison src/testdir/test_digraph.vim @ 9614:d9d3ef70c859 v7.4.2084
commit https://github.com/vim/vim/commit/60084333816c585d5858bc085b2942f813102ae3
Author: Bram Moolenaar <Bram@vim.org>
Date: Wed Jul 20 22:23:49 2016 +0200
patch 7.4.2084
Problem: New digraph test makes testing hang.
Solution: Don't set "nocp".
author | Christian Brabandt <cb@256bit.org> |
---|---|
date | Wed, 20 Jul 2016 22:30:08 +0200 |
parents | 8f1de7b71199 |
children | 6144d9bfb037 |
comparison
equal
deleted
inserted
replaced
9613:d1f933ea9f52 | 9614:d9d3ef70c859 |
---|---|
2 | 2 |
3 if !has("digraphs") || !has("multi_byte") | 3 if !has("digraphs") || !has("multi_byte") |
4 finish | 4 finish |
5 endif | 5 endif |
6 | 6 |
7 scriptencoding utf-8 | |
8 | |
7 func! Put_Dig(chars) | 9 func! Put_Dig(chars) |
8 exe "norm! o\<c-k>".a:chars | 10 exe "norm! o\<c-k>".a:chars |
9 endfu | 11 endfu |
10 | 12 |
11 func! Put_Dig_BS(char1, char2) | 13 func! Put_Dig_BS(char1, char2) |
12 exe "norm! o".a:char1."\<bs>".a:char2 | 14 exe "norm! o".a:char1."\<bs>".a:char2 |
13 endfu | 15 endfu |
14 | 16 |
15 func! Test_digraphs() | 17 func! Test_digraphs() |
16 let _enc=&enc | 18 let _enc = &enc |
17 set nocp enc=utf8 | 19 set enc=utf8 |
18 new | 20 new |
19 call Put_Dig("00") | 21 call Put_Dig("00") |
20 call assert_equal("∞", getline('.')) | 22 call assert_equal("∞", getline('.')) |
21 " not a digraph | 23 " not a digraph |
22 call Put_Dig("el") | 24 call Put_Dig("el") |
212 digraph el 108 | 214 digraph el 108 |
213 call Put_Dig("00") | 215 call Put_Dig("00") |
214 call Put_Dig("el") | 216 call Put_Dig("el") |
215 call assert_equal(['␀', 'ü', '∞', 'l'], getline(line('.')-3,line('.'))) | 217 call assert_equal(['␀', 'ü', '∞', 'l'], getline(line('.')-3,line('.'))) |
216 " reset encoding option | 218 " reset encoding option |
217 let &enc=_enc | 219 let &enc = _enc |
218 bw! | 220 bw! |
219 endfunc | 221 endfunc |
220 | 222 |
221 func! Test_digraphs_option() | 223 func! Test_digraphs_option() |
222 let _enc=&enc | 224 let _enc=&enc |
223 " reset whichwrap option, so that testing <esc><bs>A works, | 225 " reset whichwrap option, so that testing <esc><bs>A works, |
224 " without moving up a line | 226 " without moving up a line |
225 set nocp enc=utf8 digraph ww= | 227 set enc=utf8 digraph ww= |
226 new | 228 new |
227 call Put_Dig_BS("0","0") | 229 call Put_Dig_BS("0","0") |
228 call assert_equal("∞", getline('.')) | 230 call assert_equal("∞", getline('.')) |
229 " not a digraph | 231 " not a digraph |
230 call Put_Dig_BS("e","l") | 232 call Put_Dig_BS("e","l") |
420 digraph el 108 | 422 digraph el 108 |
421 call Put_Dig_BS("0","0") | 423 call Put_Dig_BS("0","0") |
422 call Put_Dig_BS("e","l") | 424 call Put_Dig_BS("e","l") |
423 call assert_equal(['␀', 'ü', '∞', 'l'], getline(line('.')-3,line('.'))) | 425 call assert_equal(['␀', 'ü', '∞', 'l'], getline(line('.')-3,line('.'))) |
424 " reset encoding option | 426 " reset encoding option |
425 let &enc=_enc | 427 let &enc = _enc |
426 set nodigraph ww&vim | 428 set nodigraph ww&vim |
427 bw! | 429 bw! |
428 endfunc | 430 endfunc |
429 | 431 |
430 " vim: tabstop=2 shiftwidth=0 sts=-1 expandtab | 432 " vim: tabstop=2 shiftwidth=0 sts=-1 expandtab |