aboutsummaryrefslogtreecommitdiff
path: root/test/functional/lua/commands_spec.lua
diff options
context:
space:
mode:
authorZyX <kp-pav@yandex.ru>2017-01-29 05:09:54 +0300
committerZyX <kp-pav@yandex.ru>2017-03-27 00:12:42 +0300
commitb4e2860c69a4e96fa305b535ce0dbdde37632fe1 (patch)
tree5cdf5fb236d5c514835033d6af9fbf9716a0c82b /test/functional/lua/commands_spec.lua
parent7a5646d594ef4ed97f1969103a1cee32733bfa2d (diff)
downloadrneovim-b4e2860c69a4e96fa305b535ce0dbdde37632fe1.tar.gz
rneovim-b4e2860c69a4e96fa305b535ce0dbdde37632fe1.tar.bz2
rneovim-b4e2860c69a4e96fa305b535ce0dbdde37632fe1.zip
doc,functests: Add documentation
Missing: updates to various lists.
Diffstat (limited to 'test/functional/lua/commands_spec.lua')
-rw-r--r--test/functional/lua/commands_spec.lua8
1 files changed, 8 insertions, 0 deletions
diff --git a/test/functional/lua/commands_spec.lua b/test/functional/lua/commands_spec.lua
index 6a37d1fd1b..c607889edb 100644
--- a/test/functional/lua/commands_spec.lua
+++ b/test/functional/lua/commands_spec.lua
@@ -2,8 +2,10 @@
local helpers = require('test.functional.helpers')(after_each)
local eq = helpers.eq
+local NIL = helpers.NIL
local clear = helpers.clear
local meths = helpers.meths
+local funcs = helpers.funcs
local source = helpers.source
local dedent = helpers.dedent
local exc_exec = helpers.exc_exec
@@ -54,4 +56,10 @@ describe(':lua command', function()
]])
eq({'', 'ETTS', 'TTSE', 'STTE'}, curbufmeths.get_lines(0, 100, false))
end)
+ it('preserves global and not preserves local variables', function()
+ eq('', redir_exec('lua gvar = 42'))
+ eq('', redir_exec('lua local lvar = 100500'))
+ eq(NIL, funcs.luaeval('lvar'))
+ eq(42, funcs.luaeval('gvar'))
+ end)
end)