~ubuntu-branches/debian/sid/neovim/sid

« back to all changes in this revision

Viewing changes to test/functional/legacy/utf8_spec.lua

  • Committer: Package Import Robot
  • Author(s): James McCoy
  • Date: 2016-04-18 21:42:19 UTC
  • mfrom: (1.1.2)
  • Revision ID: package-import@ubuntu.com-20160418214219-1e6d4o1fwqarzk46
Tags: 0.1.3-1
* New upstream release.  (Closes: #820562)
* debian/control:
  + Remove unnecessary luarocks Build-Depends
  + Add libkvm-dev Build-Depends for kfreebsd-*
  + Add python(3)-neovim to Recommends.  (Closes: #812737)
  + Declare compiance with policy 3.9.8, no changes needed.

Show diffs side-by-side

added added

removed removed

Lines of Context:
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
6
8
 
7
9
describe('utf8', function()
8
 
  setup(clear)
 
10
  before_each(clear)
9
11
 
10
12
  it('is working', function()
11
13
    insert('start:')
27
29
      xあああ
28
30
      bxbb]])
29
31
  end)
 
32
 
 
33
  it('strchars()', function()
 
34
    eq(1, eval('strchars("a")'))
 
35
    eq(1, eval('strchars("a", 0)'))
 
36
    eq(1, eval('strchars("a", 1)'))
 
37
 
 
38
    eq(3, eval('strchars("あいa")'))
 
39
    eq(3, eval('strchars("あいa", 0)'))
 
40
    eq(3, eval('strchars("あいa", 1)'))
 
41
 
 
42
    eq(2, eval('strchars("A\\u20dd")'))
 
43
    eq(2, eval('strchars("A\\u20dd", 0)'))
 
44
    eq(1, eval('strchars("A\\u20dd", 1)'))
 
45
 
 
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)'))
 
49
 
 
50
    eq(1, eval('strchars("\\u20dd")'))
 
51
    eq(1, eval('strchars("\\u20dd", 0)'))
 
52
    eq(1, eval('strchars("\\u20dd", 1)'))
 
53
  end)
 
54
 
 
55
  it('customlist completion', function()
 
56
    source([[
 
57
      function! CustomComplete1(lead, line, pos)
 
58
        return ['あ', 'い']
 
59
      endfunction
 
60
      command -nargs=1 -complete=customlist,CustomComplete1 Test1 echo]])
 
61
    feed(":Test1 <C-L>'<C-B>$put='<CR>")
 
62
 
 
63
    source([[
 
64
      function! CustomComplete2(lead, line, pos)
 
65
        return ['あたし', 'あたま', 'あたりめ']
 
66
      endfunction
 
67
      command -nargs=1 -complete=customlist,CustomComplete2 Test2 echo]])
 
68
    feed(":Test2 <C-L>'<C-B>$put='<CR>")
 
69
 
 
70
    source([[
 
71
      function! CustomComplete3(lead, line, pos)
 
72
        return ['Nこ', 'Nん', 'Nぶ']
 
73
      endfunction
 
74
      command -nargs=1 -complete=customlist,CustomComplete3 Test3 echo]])
 
75
    feed(":Test3 <C-L>'<C-B>$put='<CR>")
 
76
 
 
77
    expect([[
 
78
      
 
79
      Test1 
 
80
      Test2 あた
 
81
      Test3 N]])
 
82
  end)
30
83
end)