mirror of
https://github.com/neovim/neovim.git
synced 2025-12-15 19:05:40 +00:00
test: allow exec_lua to handle functions
Problem: Tests have lots of exec_lua calls which input blocks of code provided as unformatted strings. Solution: Teach exec_lua how to handle functions.
This commit is contained in:
committed by
Lewis Russell
parent
f32557ca67
commit
7d24c4d6b0
@@ -9,14 +9,9 @@ describe('glob', function()
|
||||
after_each(n.clear)
|
||||
|
||||
local match = function(...)
|
||||
return exec_lua(
|
||||
[[
|
||||
local pattern = select(1, ...)
|
||||
local str = select(2, ...)
|
||||
return require("vim.glob").to_lpeg(pattern):match(str) ~= nil
|
||||
]],
|
||||
...
|
||||
)
|
||||
return exec_lua(function(pattern, str)
|
||||
return require('vim.glob').to_lpeg(pattern):match(str) ~= nil
|
||||
end, ...)
|
||||
end
|
||||
|
||||
describe('glob matching', function()
|
||||
|
||||
Reference in New Issue
Block a user