diff options
author | Scott Prager <splinterofchaos@gmail.com> | 2014-10-24 16:36:30 -0400 |
---|---|---|
committer | Scott Prager <splinterofchaos@gmail.com> | 2014-12-06 17:29:39 -0500 |
commit | cea5092f40610216a83b6ab0a56d94295ce1e88a (patch) | |
tree | 95310062a5e337e3af74fc9b74517d60111f1549 /test/functional/api/vim_spec.lua | |
parent | 460843b4cd5f2bceaeac1dbc165c416b272793ed (diff) | |
download | rneovim-cea5092f40610216a83b6ab0a56d94295ce1e88a.tar.gz rneovim-cea5092f40610216a83b6ab0a56d94295ce1e88a.tar.bz2 rneovim-cea5092f40610216a83b6ab0a56d94295ce1e88a.zip |
api: Add tests for when not to handle NULs.
Diffstat (limited to 'test/functional/api/vim_spec.lua')
-rw-r--r-- | test/functional/api/vim_spec.lua | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/test/functional/api/vim_spec.lua b/test/functional/api/vim_spec.lua index f34df8cefb..2c17a2acd0 100644 --- a/test/functional/api/vim_spec.lua +++ b/test/functional/api/vim_spec.lua @@ -36,6 +36,10 @@ describe('vim_* functions', function() -- 19 * 2 (each japanese character occupies two cells) eq(44, nvim('strwidth', 'neovimのデザインかなりまともなのになってる。')) end) + + it('cannot handle NULs', function() + eq(0, nvim('strwidth', '\0abc')) + end) end) describe('{get,set}_current_line', function() @@ -52,6 +56,11 @@ describe('vim_* functions', function() eq({1, 2, {['3'] = 1}}, nvim('get_var', 'lua')) eq({1, 2, {['3'] = 1}}, nvim('eval', 'g:lua')) end) + + it('truncates values with NULs in them', function() + nvim('set_var', 'xxx', 'ab\0cd') + eq('ab', nvim('get_var', 'xxx')) + end) end) describe('{get,set}_option', function() |