3
3
local helpers = require('test.functional.helpers')
4
4
local clear, feed, insert = helpers.clear, helpers.feed, helpers.insert
5
5
local execute, expect = helpers.execute, helpers.expect
6
local eq, eval = helpers.eq, helpers.eval
7
local source = helpers.source
7
9
describe('utf8', function()
10
12
it('is working', function()
33
it('strchars()', function()
34
eq(1, eval('strchars("a")'))
35
eq(1, eval('strchars("a", 0)'))
36
eq(1, eval('strchars("a", 1)'))
38
eq(3, eval('strchars("あいa")'))
39
eq(3, eval('strchars("あいa", 0)'))
40
eq(3, eval('strchars("あいa", 1)'))
42
eq(2, eval('strchars("A\\u20dd")'))
43
eq(2, eval('strchars("A\\u20dd", 0)'))
44
eq(1, eval('strchars("A\\u20dd", 1)'))
46
eq(3, eval('strchars("A\\u20dd\\u20dd")'))
47
eq(3, eval('strchars("A\\u20dd\\u20dd", 0)'))
48
eq(1, eval('strchars("A\\u20dd\\u20dd", 1)'))
50
eq(1, eval('strchars("\\u20dd")'))
51
eq(1, eval('strchars("\\u20dd", 0)'))
52
eq(1, eval('strchars("\\u20dd", 1)'))
55
it('customlist completion', function()
57
function! CustomComplete1(lead, line, pos)
60
command -nargs=1 -complete=customlist,CustomComplete1 Test1 echo]])
61
feed(":Test1 <C-L>'<C-B>$put='<CR>")
64
function! CustomComplete2(lead, line, pos)
65
return ['あたし', 'あたま', 'あたりめ']
67
command -nargs=1 -complete=customlist,CustomComplete2 Test2 echo]])
68
feed(":Test2 <C-L>'<C-B>$put='<CR>")
71
function! CustomComplete3(lead, line, pos)
72
return ['Nこ', 'Nん', 'Nぶ']
74
command -nargs=1 -complete=customlist,CustomComplete3 Test3 echo]])
75
feed(":Test3 <C-L>'<C-B>$put='<CR>")