aboutsummaryrefslogtreecommitdiff
path: root/test/functional/lua/utility_functions_spec.lua
diff options
context:
space:
mode:
authorJustin M. Keyes <justinkz@gmail.com>2019-09-06 18:16:57 -0700
committerGitHub <noreply@github.com>2019-09-06 18:16:57 -0700
commit158b78062e9daa65203b4591dae733dd6c11ad2c (patch)
treee6988da22f16062b57d50daeda084bcc489a6a1d /test/functional/lua/utility_functions_spec.lua
parent638f2b6dee7439de303bea12dec80240617e8034 (diff)
parent7e1c9598617a140e40a0a22676c0631294617246 (diff)
downloadrneovim-158b78062e9daa65203b4591dae733dd6c11ad2c.tar.gz
rneovim-158b78062e9daa65203b4591dae733dd6c11ad2c.tar.bz2
rneovim-158b78062e9daa65203b4591dae733dd6c11ad2c.zip
Merge #10932 'test: Eliminate expect_err'
Diffstat (limited to 'test/functional/lua/utility_functions_spec.lua')
-rw-r--r--test/functional/lua/utility_functions_spec.lua17
1 files changed, 11 insertions, 6 deletions
diff --git a/test/functional/lua/utility_functions_spec.lua b/test/functional/lua/utility_functions_spec.lua
index ff15ebf8b3..ea2b1fc8a9 100644
--- a/test/functional/lua/utility_functions_spec.lua
+++ b/test/functional/lua/utility_functions_spec.lua
@@ -7,12 +7,12 @@ local clear = helpers.clear
local eq = helpers.eq
local eval = helpers.eval
local feed = helpers.feed
-local meth_pcall = helpers.meth_pcall
+local pcall_err = helpers.pcall_err
local exec_lua = helpers.exec_lua
before_each(clear)
-describe('lua function', function()
+describe('lua stdlib', function()
-- İ: `tolower("İ")` is `i` which has length 1 while `İ` itself has
-- length 2 (in bytes).
-- Ⱥ: `tolower("Ⱥ")` is `ⱥ` which has length 2 while `Ⱥ` itself has
@@ -147,11 +147,11 @@ describe('lua function', function()
eq({"yy","xx"}, exec_lua("return test_table"))
-- type checked args
- eq({false, 'Error executing lua: vim.schedule: expected function'},
- meth_pcall(exec_lua, "vim.schedule('stringly')"))
+ eq('Error executing lua: vim.schedule: expected function',
+ pcall_err(exec_lua, "vim.schedule('stringly')"))
- eq({false, 'Error executing lua: vim.schedule: expected function'},
- meth_pcall(exec_lua, "vim.schedule()"))
+ eq('Error executing lua: vim.schedule: expected function',
+ pcall_err(exec_lua, "vim.schedule()"))
exec_lua([[
vim.schedule(function()
@@ -283,4 +283,9 @@ describe('lua function', function()
assert(is_dc)
end)
+
+ it('vim.pesc', function()
+ eq('foo%-bar', exec_lua([[return vim.pesc('foo-bar')]]))
+ eq('foo%%%-bar', exec_lua([[return vim.pesc(vim.pesc('foo-bar'))]]))
+ end)
end)