diff options
author | ZyX <kp-pav@yandex.ru> | 2016-02-06 02:46:23 +0300 |
---|---|---|
committer | ZyX <kp-pav@yandex.ru> | 2016-04-18 02:45:49 +0300 |
commit | 6167ce6df2753d5474ad49aea19f5957128ab015 (patch) | |
tree | 525c160abf96abf5eae58a6bcfab46ae4d6cd728 /test | |
parent | a3b87fc19b652065d96cec8f571d3245f1fc2446 (diff) | |
download | rneovim-6167ce6df2753d5474ad49aea19f5957128ab015.tar.gz rneovim-6167ce6df2753d5474ad49aea19f5957128ab015.tar.bz2 rneovim-6167ce6df2753d5474ad49aea19f5957128ab015.zip |
eval: Remove v:none
To get v:none back just rever this commit. This will not make json*() functions
compatible with Vim though.
Diffstat (limited to 'test')
-rw-r--r-- | test/functional/eval/msgpack_functions_spec.lua | 7 | ||||
-rw-r--r-- | test/functional/eval/special_vars_spec.lua | 32 | ||||
-rw-r--r-- | test/functional/eval/string_spec.lua | 1 |
3 files changed, 1 insertions, 39 deletions
diff --git a/test/functional/eval/msgpack_functions_spec.lua b/test/functional/eval/msgpack_functions_spec.lua index 3d539d855d..a602bad86f 100644 --- a/test/functional/eval/msgpack_functions_spec.lua +++ b/test/functional/eval/msgpack_functions_spec.lua @@ -645,11 +645,6 @@ describe('msgpackdump() function', function() exc_exec('call msgpackdump([todump])')) end) - it('fails to dump v:none', function() - eq('Vim(call):E953: Attempt to convert v:none in msgpackdump() argument, index 0, itself', - exc_exec('call msgpackdump([v:none])')) - end) - it('fails when called with no arguments', function() eq('Vim(call):E119: Not enough arguments for function: msgpackdump', exc_exec('call msgpackdump()')) @@ -686,7 +681,7 @@ describe('msgpackdump() function', function() end) it('fails to dump special value', function() - for _, val in ipairs({'v:true', 'v:false', 'v:null', 'v:none'}) do + for _, val in ipairs({'v:true', 'v:false', 'v:null'}) do eq('Vim(call):E686: Argument of msgpackdump() must be a List', exc_exec('call msgpackdump(' .. val .. ')')) end diff --git a/test/functional/eval/special_vars_spec.lua b/test/functional/eval/special_vars_spec.lua index c7df847946..b5c65d23d9 100644 --- a/test/functional/eval/special_vars_spec.lua +++ b/test/functional/eval/special_vars_spec.lua @@ -28,21 +28,15 @@ describe('Special values', function() eq(0, funcs.empty(true)) eq(1, funcs.empty(false)) eq(1, eval('empty(v:null)')) - eq(1, eval('empty(v:none)')) end) it('can be stringified and eval’ed back', function() eq(true, funcs.eval(funcs.string(true))) eq(false, funcs.eval(funcs.string(false))) eq(nil, eval('eval(string(v:null))')) - eq(1, eval('eval(string(v:none)) is# v:none')) end) it('work with is/isnot properly', function() - eq(1, eval('v:none is v:none')) - eq(0, eval('v:none is v:null')) - eq(0, eval('v:none is v:true')) - eq(0, eval('v:none is v:false')) eq(1, eval('v:null is v:null')) eq(0, eval('v:null is v:true')) eq(0, eval('v:null is v:false')) @@ -50,35 +44,26 @@ describe('Special values', function() eq(0, eval('v:true is v:false')) eq(1, eval('v:false is v:false')) - eq(0, eval('v:none is 0')) eq(0, eval('v:null is 0')) eq(0, eval('v:true is 0')) eq(0, eval('v:false is 0')) - eq(0, eval('v:none is 1')) eq(0, eval('v:null is 1')) eq(0, eval('v:true is 1')) eq(0, eval('v:false is 1')) - eq(0, eval('v:none is ""')) eq(0, eval('v:null is ""')) eq(0, eval('v:true is ""')) eq(0, eval('v:false is ""')) - eq(0, eval('v:none is "none"')) eq(0, eval('v:null is "null"')) eq(0, eval('v:true is "true"')) eq(0, eval('v:false is "false"')) - eq(0, eval('v:none is []')) eq(0, eval('v:null is []')) eq(0, eval('v:true is []')) eq(0, eval('v:false is []')) - eq(0, eval('v:none isnot v:none')) - eq(1, eval('v:none isnot v:null')) - eq(1, eval('v:none isnot v:true')) - eq(1, eval('v:none isnot v:false')) eq(0, eval('v:null isnot v:null')) eq(1, eval('v:null isnot v:true')) eq(1, eval('v:null isnot v:false')) @@ -86,27 +71,22 @@ describe('Special values', function() eq(1, eval('v:true isnot v:false')) eq(0, eval('v:false isnot v:false')) - eq(1, eval('v:none isnot 0')) eq(1, eval('v:null isnot 0')) eq(1, eval('v:true isnot 0')) eq(1, eval('v:false isnot 0')) - eq(1, eval('v:none isnot 1')) eq(1, eval('v:null isnot 1')) eq(1, eval('v:true isnot 1')) eq(1, eval('v:false isnot 1')) - eq(1, eval('v:none isnot ""')) eq(1, eval('v:null isnot ""')) eq(1, eval('v:true isnot ""')) eq(1, eval('v:false isnot ""')) - eq(1, eval('v:none isnot "none"')) eq(1, eval('v:null isnot "null"')) eq(1, eval('v:true isnot "true"')) eq(1, eval('v:false isnot "false"')) - eq(1, eval('v:none isnot []')) eq(1, eval('v:null isnot []')) eq(1, eval('v:true isnot []')) eq(1, eval('v:false isnot []')) @@ -114,17 +94,14 @@ describe('Special values', function() it('work with +/-/* properly', function() eq(1, eval('0 + v:true')) - eq(0, eval('0 + v:none')) eq(0, eval('0 + v:null')) eq(0, eval('0 + v:false')) eq(-1, eval('0 - v:true')) - eq( 0, eval('0 - v:none')) eq( 0, eval('0 - v:null')) eq( 0, eval('0 - v:false')) eq(1, eval('1 * v:true')) - eq(0, eval('1 * v:none')) eq(0, eval('1 * v:null')) eq(0, eval('1 * v:false')) end) @@ -132,28 +109,23 @@ describe('Special values', function() it('does not work with +=/-=/.=', function() meths.set_var('true', true) meths.set_var('false', false) - execute('let none = v:none') execute('let null = v:null') eq('Vim(let):E734: Wrong variable type for +=', exc_exec('let true += 1')) eq('Vim(let):E734: Wrong variable type for +=', exc_exec('let false += 1')) - eq('Vim(let):E734: Wrong variable type for +=', exc_exec('let none += 1')) eq('Vim(let):E734: Wrong variable type for +=', exc_exec('let null += 1')) eq('Vim(let):E734: Wrong variable type for -=', exc_exec('let true -= 1')) eq('Vim(let):E734: Wrong variable type for -=', exc_exec('let false -= 1')) - eq('Vim(let):E734: Wrong variable type for -=', exc_exec('let none -= 1')) eq('Vim(let):E734: Wrong variable type for -=', exc_exec('let null -= 1')) eq('Vim(let):E734: Wrong variable type for .=', exc_exec('let true .= 1')) eq('Vim(let):E734: Wrong variable type for .=', exc_exec('let false .= 1')) - eq('Vim(let):E734: Wrong variable type for .=', exc_exec('let none .= 1')) eq('Vim(let):E734: Wrong variable type for .=', exc_exec('let null .= 1')) end) it('work with . (concat) properly', function() eq("true", eval('"" . v:true')) - eq("none", eval('"" . v:none')) eq("null", eval('"" . v:null')) eq("false", eval('"" . v:false')) end) @@ -162,25 +134,21 @@ describe('Special values', function() eq(6, funcs.type(true)) eq(6, funcs.type(false)) eq(7, eval('type(v:null)')) - eq(7, eval('type(v:none)')) end) it('work with copy() and deepcopy()', function() eq(true, funcs.deepcopy(true)) eq(false, funcs.deepcopy(false)) eq(nil, eval('deepcopy(v:null)')) - eq(nil, eval('deepcopy(v:none)')) eq(true, funcs.copy(true)) eq(false, funcs.copy(false)) eq(nil, eval('copy(v:null)')) - eq(nil, eval('copy(v:none)')) end) it('fails in index', function() eq('Vim(echo):E15: Cannot index a special value', exc_exec('echo v:true[0]')) eq('Vim(echo):E15: Cannot index a special value', exc_exec('echo v:false[0]')) - eq('Vim(echo):E15: Cannot index a special value', exc_exec('echo v:none[0]')) eq('Vim(echo):E15: Cannot index a special value', exc_exec('echo v:null[0]')) end) end) diff --git a/test/functional/eval/string_spec.lua b/test/functional/eval/string_spec.lua index fe79708910..0c4ff87231 100644 --- a/test/functional/eval/string_spec.lua +++ b/test/functional/eval/string_spec.lua @@ -31,7 +31,6 @@ describe('string() function', function() it('dumps special v: values', function() eq('v:true', eval('string(v:true)')) eq('v:false', eval('string(v:false)')) - eq('v:none', eval('string(v:none)')) eq('v:null', eval('string(v:null)')) end) |