Mercurial > vim
diff src/testdir/test_digraph.vim @ 25378:890fd8211202 v8.2.3226
patch 8.2.3226: new digraph functions use old naming scheme
Commit: https://github.com/vim/vim/commit/29b857150c111a455f1a38a8f748243524f692e1
Author: h-east <h.east.727@gmail.com>
Date: Mon Jul 26 21:54:04 2021 +0200
patch 8.2.3226: new digraph functions use old naming scheme
Problem: New digraph functions use old naming scheme.
Solution: Use the digraph_ prefix. (Hirohito Higashi, closes https://github.com/vim/vim/issues/8580)
author | Bram Moolenaar <Bram@vim.org> |
---|---|
date | Mon, 26 Jul 2021 22:00:07 +0200 |
parents | c626fd34b66f |
children | 6b711b01f2ca |
line wrap: on
line diff
--- a/src/testdir/test_digraph.vim +++ b/src/testdir/test_digraph.vim @@ -515,81 +515,81 @@ func Test_entering_digraph() call StopVimInTerminal(buf) endfunc -func Test_setdigraph_function() +func Test_digraph_set_function() new - call setdigraph('aa', 'あ') + call digraph_set('aa', 'あ') call Put_Dig('aa') call assert_equal('あ', getline('$')) - call setdigraph(' i', 'い') + call digraph_set(' i', 'い') call Put_Dig(' i') call assert_equal('い', getline('$')) - call setdigraph(' ', 'う') + call digraph_set(' ', 'う') call Put_Dig(' ') call assert_equal('う', getline('$')) - eval 'aa'->setdigraph('え') + eval 'aa'->digraph_set('え') call Put_Dig('aa') call assert_equal('え', getline('$')) - call assert_fails('call setdigraph("aaa", "あ")', 'E1214: Digraph must be just two characters: aaa') - call assert_fails('call setdigraph("b", "あ")', 'E1214: Digraph must be just two characters: b') - call assert_fails('call setdigraph("あ", "あ")', 'E1214: Digraph must be just two characters: あ') - call assert_fails('call setdigraph("aa", "ああ")', 'E1215: Digraph must be one character: ああ') - call assert_fails('call setdigraph("aa", "か" .. nr2char(0x3099))', 'E1215: Digraph must be one character: か' .. nr2char(0x3099)) + call assert_fails('call digraph_set("aaa", "あ")', 'E1214: Digraph must be just two characters: aaa') + call assert_fails('call digraph_set("b", "あ")', 'E1214: Digraph must be just two characters: b') + call assert_fails('call digraph_set("あ", "あ")', 'E1214: Digraph must be just two characters: あ') + call assert_fails('call digraph_set("aa", "ああ")', 'E1215: Digraph must be one character: ああ') + call assert_fails('call digraph_set("aa", "か" .. nr2char(0x3099))', 'E1215: Digraph must be one character: か' .. nr2char(0x3099)) bwipe! endfunc -func Test_getdigraph_function() +func Test_digraph_get_function() " Built-in digraphs - call assert_equal('∞', getdigraph('00')) + call assert_equal('∞', digraph_get('00')) " User-defined digraphs - call setdigraph('aa', 'あ') - call setdigraph(' i', 'い') - call setdigraph(' ', 'う') - call assert_equal('あ', getdigraph('aa')) - call assert_equal('あ', 'aa'->getdigraph()) - call assert_equal('い', getdigraph(' i')) - call assert_equal('う', getdigraph(' ')) - call assert_fails('call getdigraph("aaa")', 'E1214: Digraph must be just two characters: aaa') - call assert_fails('call getdigraph("b")', 'E1214: Digraph must be just two characters: b') + call digraph_set('aa', 'あ') + call digraph_set(' i', 'い') + call digraph_set(' ', 'う') + call assert_equal('あ', digraph_get('aa')) + call assert_equal('あ', 'aa'->digraph_get()) + call assert_equal('い', digraph_get(' i')) + call assert_equal('う', digraph_get(' ')) + call assert_fails('call digraph_get("aaa")', 'E1214: Digraph must be just two characters: aaa') + call assert_fails('call digraph_get("b")', 'E1214: Digraph must be just two characters: b') endfunc -func Test_getdigraph_function_encode() +func Test_digraph_get_function_encode() CheckFeature iconv let testcases = { \'00': '∞', \'aa': 'あ', \} for [key, ch] in items(testcases) - call setdigraph(key, ch) + call digraph_set(key, ch) set encoding=japan - call assert_equal(iconv(ch, 'utf-8', 'japan'), getdigraph(key)) + call assert_equal(iconv(ch, 'utf-8', 'japan'), digraph_get(key)) set encoding& endfor endfunc -func Test_setdigraphlist_function() - call setdigraphlist([['aa', 'き'], ['bb', 'く']]) - call assert_equal('き', getdigraph('aa')) - call assert_equal('く', getdigraph('bb')) +func Test_digraph_setlist_function() + call digraph_setlist([['aa', 'き'], ['bb', 'く']]) + call assert_equal('き', digraph_get('aa')) + call assert_equal('く', digraph_get('bb')) - call assert_fails('call setdigraphlist([[]])', 'E1216:') - call assert_fails('call setdigraphlist([["aa", "b", "cc"]])', '1216:') - call assert_fails('call setdigraphlist([["あ", "あ"]])', 'E1214: Digraph must be just two characters: あ') + call assert_fails('call digraph_setlist([[]])', 'E1216:') + call assert_fails('call digraph_setlist([["aa", "b", "cc"]])', '1216:') + call assert_fails('call digraph_setlist([["あ", "あ"]])', 'E1214: Digraph must be just two characters: あ') endfunc -func Test_getdigraphlist_function() +func Test_digraph_getlist_function() " Make sure user-defined digraphs are defined - call setdigraphlist([['aa', 'き'], ['bb', 'く']]) + call digraph_setlist([['aa', 'き'], ['bb', 'く']]) - for pair in getdigraphlist(1) - call assert_equal(getdigraph(pair[0]), pair[1]) + for pair in digraph_getlist(1) + call assert_equal(digraph_get(pair[0]), pair[1]) endfor " We don't know how many digraphs are registered before, so check the number " of digraphs returned. - call assert_equal(getdigraphlist()->len(), getdigraphlist(0)->len()) - call assert_notequal((getdigraphlist()->len()), getdigraphlist(1)->len()) + call assert_equal(digraph_getlist()->len(), digraph_getlist(0)->len()) + call assert_notequal((digraph_getlist()->len()), digraph_getlist(1)->len()) endfunc " vim: shiftwidth=2 sts=2 expandtab