comparison src/testdir/test_digraph.vim @ 25577:6b711b01f2ca v8.2.3325

patch 8.2.3325: digraph test fails when LC_ALL is set to "C" Commit: https://github.com/vim/vim/commit/52eb372a04dfc5d5afef238c1b3c4a8e92020837 Author: Bram Moolenaar <Bram@vim.org> Date: Tue Aug 10 21:39:20 2021 +0200 patch 8.2.3325: digraph test fails when LC_ALL is set to "C" Problem: Digraph test fails when LC_ALL is set to "C". Solution: When restoring 'encoding' set it to "utf-8". (closes https://github.com/vim/vim/issues/8742)
author Bram Moolenaar <Bram@vim.org>
date Tue, 10 Aug 2021 21:45:04 +0200
parents 890fd8211202
children ea0820d05257
comparison
equal deleted inserted replaced
25576:432231e720aa 25577:6b711b01f2ca
555 call assert_fails('call digraph_get("b")', 'E1214: Digraph must be just two characters: b') 555 call assert_fails('call digraph_get("b")', 'E1214: Digraph must be just two characters: b')
556 endfunc 556 endfunc
557 557
558 func Test_digraph_get_function_encode() 558 func Test_digraph_get_function_encode()
559 CheckFeature iconv 559 CheckFeature iconv
560
560 let testcases = { 561 let testcases = {
561 \'00': '∞', 562 \'00': '∞',
562 \'aa': 'あ', 563 \'aa': 'あ',
563 \} 564 \}
564 for [key, ch] in items(testcases) 565 for [key, ch] in items(testcases)
565 call digraph_set(key, ch) 566 call digraph_set(key, ch)
566 set encoding=japan 567 set encoding=japan
567 call assert_equal(iconv(ch, 'utf-8', 'japan'), digraph_get(key)) 568 call assert_equal(iconv(ch, 'utf-8', 'japan'), digraph_get(key))
568 set encoding& 569 set encoding=utf-8
569 endfor 570 endfor
570 endfunc 571 endfunc
571 572
572 func Test_digraph_setlist_function() 573 func Test_digraph_setlist_function()
573 call digraph_setlist([['aa', 'き'], ['bb', 'く']]) 574 call digraph_setlist([['aa', 'き'], ['bb', 'く']])
590 " We don't know how many digraphs are registered before, so check the number 591 " We don't know how many digraphs are registered before, so check the number
591 " of digraphs returned. 592 " of digraphs returned.
592 call assert_equal(digraph_getlist()->len(), digraph_getlist(0)->len()) 593 call assert_equal(digraph_getlist()->len(), digraph_getlist(0)->len())
593 call assert_notequal((digraph_getlist()->len()), digraph_getlist(1)->len()) 594 call assert_notequal((digraph_getlist()->len()), digraph_getlist(1)->len())
594 endfunc 595 endfunc
596
597
595 " vim: shiftwidth=2 sts=2 expandtab 598 " vim: shiftwidth=2 sts=2 expandtab