From 6e5498c3e32ecc7adfedc3f47b876f82de90fff8 Mon Sep 17 00:00:00 2001 From: ZyX Date: Sun, 31 Jan 2016 02:28:53 +0300 Subject: runtime/msgpack: Add support for special values --- test/functional/plugin/msgpack_spec.lua | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) (limited to 'test/functional/plugin/msgpack_spec.lua') diff --git a/test/functional/plugin/msgpack_spec.lua b/test/functional/plugin/msgpack_spec.lua index 90cc2af9c0..197a1a92e5 100644 --- a/test/functional/plugin/msgpack_spec.lua +++ b/test/functional/plugin/msgpack_spec.lua @@ -1,4 +1,5 @@ local helpers = require('test.functional.helpers') +local meths = helpers.meths local eq, nvim_eval, nvim_command, exc_exec = helpers.eq, helpers.eval, helpers.command, helpers.exc_exec local ok = helpers.ok @@ -409,6 +410,12 @@ describe('In autoload/msgpack.vim', function() string_eq('nan', '(1.0/0.0-1.0/0.0)') string_eq('nan', '-(1.0/0.0-1.0/0.0)') end) + + it('works for special v: values like v:true', function() + string_eq('TRUE', 'v:true') + string_eq('FALSE', 'v:false') + string_eq('NIL', 'v:null') + end) end) describe('function msgpack#deepcopy', function() @@ -523,6 +530,20 @@ describe('In autoload/msgpack.vim', function() eq(2.0, nvim_eval('flt2')) eq('abc', nvim_eval('bin2')) end) + + it('works for special v: values like v:true', function() + meths.set_var('true', true) + meths.set_var('false', false) + nvim_command('let nil = v:null') + + nvim_command('let true2 = msgpack#deepcopy(true)') + nvim_command('let false2 = msgpack#deepcopy(false)') + nvim_command('let nil2 = msgpack#deepcopy(nil)') + + eq(true, meths.get_var('true')) + eq(false, meths.get_var('false')) + eq(nil, meths.get_var('nil')) + end) end) describe('function msgpack#eval', function() -- cgit From a64114eba017c0db3d1849186c9c54fb09308761 Mon Sep 17 00:00:00 2001 From: ZyX Date: Mon, 18 Apr 2016 01:37:21 +0300 Subject: functests: Make json_functions_spec use new NIL where appropriate --- test/functional/plugin/msgpack_spec.lua | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'test/functional/plugin/msgpack_spec.lua') diff --git a/test/functional/plugin/msgpack_spec.lua b/test/functional/plugin/msgpack_spec.lua index 197a1a92e5..246b26188f 100644 --- a/test/functional/plugin/msgpack_spec.lua +++ b/test/functional/plugin/msgpack_spec.lua @@ -534,7 +534,7 @@ describe('In autoload/msgpack.vim', function() it('works for special v: values like v:true', function() meths.set_var('true', true) meths.set_var('false', false) - nvim_command('let nil = v:null') + meths.set_var('nil', NIL) nvim_command('let true2 = msgpack#deepcopy(true)') nvim_command('let false2 = msgpack#deepcopy(false)') @@ -542,7 +542,7 @@ describe('In autoload/msgpack.vim', function() eq(true, meths.get_var('true')) eq(false, meths.get_var('false')) - eq(nil, meths.get_var('nil')) + eq(NIL, meths.get_var('nil')) end) end) -- cgit