diff options
author | Lewis Russell <lewis6991@gmail.com> | 2024-07-29 11:20:15 +0100 |
---|---|---|
committer | Lewis Russell <me@lewisr.dev> | 2024-08-02 19:04:37 +0100 |
commit | 7d24c4d6b0413cd5af8d0579f0a9a694db7f775e (patch) | |
tree | d9954c2001fe512c60a76561e7a19566b9de638b /test/functional/lua/glob_spec.lua | |
parent | f32557ca679cbb1d7de52ab54dc35585af9ab9d0 (diff) | |
download | rneovim-7d24c4d6b0413cd5af8d0579f0a9a694db7f775e.tar.gz rneovim-7d24c4d6b0413cd5af8d0579f0a9a694db7f775e.tar.bz2 rneovim-7d24c4d6b0413cd5af8d0579f0a9a694db7f775e.zip |
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.
Diffstat (limited to 'test/functional/lua/glob_spec.lua')
-rw-r--r-- | test/functional/lua/glob_spec.lua | 11 |
1 files changed, 3 insertions, 8 deletions
diff --git a/test/functional/lua/glob_spec.lua b/test/functional/lua/glob_spec.lua index b95d874bb5..6f1e5be501 100644 --- a/test/functional/lua/glob_spec.lua +++ b/test/functional/lua/glob_spec.lua @@ -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() |