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

« back to all changes in this revision

Viewing changes to test/functional/api/vim_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 Screen = require('test.functional.ui.screen')
4
4
local clear, nvim, eq, neq = helpers.clear, helpers.nvim, helpers.eq, helpers.neq
5
5
local ok, nvim_async, feed = helpers.ok, helpers.nvim_async, helpers.feed
6
 
local os_is_windows = helpers.os_is_windows
 
6
local os_name = helpers.os_name
7
7
 
8
8
describe('vim_* functions', function()
9
9
  before_each(clear)
17
17
      nvim('command', 'w')
18
18
      local f = io.open(fname)
19
19
      ok(f ~= nil)
20
 
      if os_is_windows() then
 
20
      if os_name() == 'windows' then
21
21
        eq('testing\r\napi\r\n', f:read('*a'))
22
22
      else
23
23
        eq('testing\napi\n', f:read('*a'))
144
144
 
145
145
  describe('replace_termcodes', function()
146
146
    it('escapes K_SPECIAL as K_SPECIAL KS_SPECIAL KE_FILLER', function()
147
 
      eq(helpers.nvim('replace_termcodes', '\128', true, true, true), '\128\254X')
 
147
      eq('\128\254X', helpers.nvim('replace_termcodes', '\128', true, true, true))
148
148
    end)
149
149
 
150
 
    it('leaves non K_SPECIAL string unchanged', function()
151
 
      eq(helpers.nvim('replace_termcodes', 'abc', true, true, true), 'abc')
 
150
    it('leaves non-K_SPECIAL string unchanged', function()
 
151
      eq('abc', helpers.nvim('replace_termcodes', 'abc', true, true, true))
152
152
    end)
153
153
 
154
154
    it('converts <expressions>', function()
155
 
      eq(helpers.nvim('replace_termcodes', '<Leader>', true, true, true), '\\')
 
155
      eq('\\', helpers.nvim('replace_termcodes', '<Leader>', true, true, true))
 
156
    end)
 
157
 
 
158
    it('converts <LeftMouse> to K_SPECIAL KS_EXTRA KE_LEFTMOUSE', function()
 
159
      -- K_SPECIAL KS_EXTRA KE_LEFTMOUSE
 
160
      -- 0x80      0xfd     0x2c
 
161
      -- 128       253      44
 
162
      eq('\128\253\44', helpers.nvim('replace_termcodes',
 
163
                                     '<LeftMouse>', true, true, true))
156
164
    end)
157
165
  end)
158
166