Skip to content

Commit e25bc5a

Browse files
committed
patch 7.4.2087
Problem: Digraph code test coverage is still low. Solution: Add more tests. (Christian Brabandt)
1 parent ac105ed commit e25bc5a

2 files changed

Lines changed: 37 additions & 0 deletions

File tree

src/testdir/test_digraph.vim

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -420,4 +420,39 @@ func! Test_digraphs_option()
420420
bw!
421421
endfunc
422422

423+
func! Test_digraphs_output()
424+
new
425+
let out = execute(':digraph')
426+
call assert_equal('Eu € 8364', matchstr(out, '\C\<Eu\D*8364\>'))
427+
call assert_equal('=e € 8364', matchstr(out, '\C=e\D*8364\>'))
428+
call assert_equal('=R ₽ 8381', matchstr(out, '\C=R\D*8381\>'))
429+
call assert_equal('=P ₽ 8381', matchstr(out, '\C=P\D*8381\>'))
430+
call assert_equal('o: ö 246', matchstr(out, '\C\<o:\D*246\>'))
431+
call assert_equal('v4 ㄪ 12586', matchstr(out, '\C\<v4\D*12586\>'))
432+
call assert_equal("'0 ˚ 730", matchstr(out, '\C''0\D*730\>'))
433+
call assert_equal('Z% Ж 1046', matchstr(out, '\C\<Z%\D*1046\>'))
434+
call assert_equal('u- ū 363', matchstr(out, '\C\<u-\D*363\>'))
435+
call assert_equal('SH ^A 1', matchstr(out, '\C\<SH\D*1\>'))
436+
bw!
437+
endfunc
438+
439+
func! Test_loadkeymap()
440+
new
441+
set keymap=czech
442+
set iminsert=0
443+
call feedkeys("o|\<c-^>|01234567890|\<esc>", 'tx')
444+
call assert_equal("|'é+ěščřžýáíé'", getline('.'))
445+
" reset keymap and encoding option
446+
set keymap=
447+
bw!
448+
endfunc
449+
450+
func! Test_digraph_cmndline()
451+
" Create digraph on commandline
452+
" This is a hack, to let Vim create the digraph in commandline mode
453+
let s = ''
454+
exe "sil! norm! :let s.='\<c-k>Eu'\<cr>"
455+
call assert_equal("", s)
456+
endfunc
457+
423458
" vim: tabstop=2 shiftwidth=0 sts=-1 expandtab

src/version.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -758,6 +758,8 @@ static char *(features[]) =
758758

759759
static int included_patches[] =
760760
{ /* Add new patch number below this line */
761+
/**/
762+
2087,
761763
/**/
762764
2086,
763765
/**/

0 commit comments

Comments
 (0)