diff options
Diffstat (limited to 'test')
-rw-r--r-- | test/functional/api/buffer_spec.lua | 5 | ||||
-rw-r--r-- | test/functional/api/vim_spec.lua | 9 | ||||
-rw-r--r-- | test/functional/helpers.lua | 2 | ||||
-rw-r--r-- | test/functional/legacy/033_lisp_indent_spec.lua | 20 |
4 files changed, 25 insertions, 11 deletions
diff --git a/test/functional/api/buffer_spec.lua b/test/functional/api/buffer_spec.lua index 169d605b63..b85594f7af 100644 --- a/test/functional/api/buffer_spec.lua +++ b/test/functional/api/buffer_spec.lua @@ -34,6 +34,11 @@ describe('buffer_* functions', function() curbuf('del_line', 0) eq('', curbuf('get_line', 0)) end) + + it('can handle NULs', function() + curbuf('set_line', 0, 'ab\0cd') + eq('ab\0cd', curbuf('get_line', 0)) + end) end) 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() diff --git a/test/functional/helpers.lua b/test/functional/helpers.lua index b758817b41..15adc3b1c3 100644 --- a/test/functional/helpers.lua +++ b/test/functional/helpers.lua @@ -161,7 +161,7 @@ end local function clear() if session then session:request('vim_command', 'qa!') - session._async_session._msgpack_stream._loop:exit() + session:exit() end local loop = Loop.new() local msgpack_stream = MsgpackStream.new(loop) diff --git a/test/functional/legacy/033_lisp_indent_spec.lua b/test/functional/legacy/033_lisp_indent_spec.lua index 3ee248815d..0a5577fad3 100644 --- a/test/functional/legacy/033_lisp_indent_spec.lua +++ b/test/functional/legacy/033_lisp_indent_spec.lua @@ -22,7 +22,7 @@ describe('lisp indent', function() :if-exists :supersede) (let ((,ti ,title)) (as title ,ti) - (with center + (with center (as h2 (string-upcase ,ti))) (brs 3) ,@body)))) @@ -35,7 +35,7 @@ describe('lisp indent', function() ,@body (princ "</a>")))]]) - execute('set lisp expandtab') + execute('set lisp') execute('/^(defun') feed('=G:/^(defun/,$yank A<cr>') @@ -52,15 +52,15 @@ describe('lisp indent', function() (defmacro page (name title &rest body) (let ((ti (gensym))) `(with-open-file (*standard-output* - (html-file ,name) - :direction :output - :if-exists :supersede) + (html-file ,name) + :direction :output + :if-exists :supersede) (let ((,ti ,title)) - (as title ,ti) - (with center - (as h2 (string-upcase ,ti))) - (brs 3) - ,@body)))) + (as title ,ti) + (with center + (as h2 (string-upcase ,ti))) + (brs 3) + ,@body)))) ;;; Utilities for generating links |