aboutsummaryrefslogtreecommitdiff
path: root/test/functional/lua/luaeval_spec.lua
diff options
context:
space:
mode:
authorSean Dewar <seandewar@users.noreply.github.com>2021-08-31 23:49:43 +0100
committerSean Dewar <seandewar@users.noreply.github.com>2021-10-03 20:06:33 +0100
commit86593beaa40035a10a664d3147327a01f4885cb7 (patch)
tree9a305c6bc4c1497bc9c40d38e059a6593c0d363b /test/functional/lua/luaeval_spec.lua
parent59c8a1fd5158886cb13b56070ebf15259d12eba2 (diff)
downloadrneovim-86593beaa40035a10a664d3147327a01f4885cb7.tar.gz
rneovim-86593beaa40035a10a664d3147327a01f4885cb7.tar.bz2
rneovim-86593beaa40035a10a664d3147327a01f4885cb7.zip
feat(eval/method): partially port v8.1.1954
Does not include listener_*() functions. js_*() functions are N/A. json_encode() and json_decode() didn't include tests; add some anyway (to json_functions_spec.lua). test_lua.vim isn't included yet, so add tests to luaeval_spec.lua.
Diffstat (limited to 'test/functional/lua/luaeval_spec.lua')
-rw-r--r--test/functional/lua/luaeval_spec.lua7
1 files changed, 4 insertions, 3 deletions
diff --git a/test/functional/lua/luaeval_spec.lua b/test/functional/lua/luaeval_spec.lua
index 255e99032f..0675ec9abd 100644
--- a/test/functional/lua/luaeval_spec.lua
+++ b/test/functional/lua/luaeval_spec.lua
@@ -86,14 +86,15 @@ describe('luaeval()', function()
-- meaningful later.
it('correctly evaluates scalars', function()
+ -- Also test method call (->) syntax
eq(1, funcs.luaeval('1'))
- eq(0, eval('type(luaeval("1"))'))
+ eq(0, eval('"1"->luaeval()->type()'))
eq(1.5, funcs.luaeval('1.5'))
- eq(5, eval('type(luaeval("1.5"))'))
+ eq(5, eval('"1.5"->luaeval()->type()'))
eq("test", funcs.luaeval('"test"'))
- eq(1, eval('type(luaeval("\'test\'"))'))
+ eq(1, eval('"\'test\'"->luaeval()->type()'))
eq('', funcs.luaeval('""'))
eq('\000', funcs.luaeval([['\0']]))