aboutsummaryrefslogtreecommitdiff
path: root/test/helpers.lua
diff options
context:
space:
mode:
authorJustin M. Keyes <justinkz@gmail.com>2017-01-22 11:10:24 +0100
committerJustin M. Keyes <justinkz@gmail.com>2017-01-22 11:10:24 +0100
commit043d8ba422b4f35d82e8acef8438248de94ab167 (patch)
treef87277f9d764b19fdcd529db24d4f0854b8ed81c /test/helpers.lua
parentc86caf7e41c77f85861fc92e1ef1462508d74b24 (diff)
parentb7ee8fbc814c94ce6667a4d7701e53d7724ee260 (diff)
downloadrneovim-043d8ba422b4f35d82e8acef8438248de94ab167.tar.gz
rneovim-043d8ba422b4f35d82e8acef8438248de94ab167.tar.bz2
rneovim-043d8ba422b4f35d82e8acef8438248de94ab167.zip
Merge #5782 'Visual-mode put from @. register'
Diffstat (limited to 'test/helpers.lua')
-rw-r--r--test/helpers.lua20
1 files changed, 20 insertions, 0 deletions
diff --git a/test/helpers.lua b/test/helpers.lua
index def0740f85..3f7a9c2b74 100644
--- a/test/helpers.lua
+++ b/test/helpers.lua
@@ -91,6 +91,24 @@ local function tmpname()
end
end
+local function map(func, tab)
+ local rettab = {}
+ for k, v in pairs(tab) do
+ rettab[k] = func(v)
+ end
+ return rettab
+end
+
+local function filter(filter_func, tab)
+ local rettab = {}
+ for _, entry in pairs(tab) do
+ if filter_func(entry) then
+ table.insert(rettab, entry)
+ end
+ end
+ return rettab
+end
+
return {
eq = eq,
neq = neq,
@@ -98,4 +116,6 @@ return {
check_logs = check_logs,
uname = uname,
tmpname = tmpname,
+ map = map,
+ filter = filter,
}