aboutsummaryrefslogtreecommitdiff
path: root/dot_config/herdr/plugins/github/herdr-splits-d880c4924f2b/tests/test_plugin.lua
diff options
context:
space:
mode:
authorPablu <me@pablu.de>2026-07-29 08:36:58 +0200
committerPablu <me@pablu.de>2026-07-29 08:36:58 +0200
commit75f2079ddf60f8901bd436e1cb908c189a8a9037 (patch)
tree114877450da032bddfc648a044a0af64e9b58449 /dot_config/herdr/plugins/github/herdr-splits-d880c4924f2b/tests/test_plugin.lua
parent3f66debcc79bd995797c029338de36a0b463f20f (diff)
Add jj and herdr
Diffstat (limited to 'dot_config/herdr/plugins/github/herdr-splits-d880c4924f2b/tests/test_plugin.lua')
-rw-r--r--dot_config/herdr/plugins/github/herdr-splits-d880c4924f2b/tests/test_plugin.lua60
1 files changed, 60 insertions, 0 deletions
diff --git a/dot_config/herdr/plugins/github/herdr-splits-d880c4924f2b/tests/test_plugin.lua b/dot_config/herdr/plugins/github/herdr-splits-d880c4924f2b/tests/test_plugin.lua
new file mode 100644
index 0000000..0afc929
--- /dev/null
+++ b/dot_config/herdr/plugins/github/herdr-splits-d880c4924f2b/tests/test_plugin.lua
@@ -0,0 +1,60 @@
+local T
+local expect = MiniTest.expect
+local child = MiniTest.new_child_neovim()
+
+local source = debug.getinfo(1, 'S').source
+local root = vim.fn.fnamemodify(source:sub(2), ':p:h:h')
+
+T = MiniTest.new_set({
+ hooks = {
+ pre_case = function()
+ child.restart({ '--noplugin', '-u', 'NONE', '-i', 'NONE' })
+ child.cmd('set runtimepath^=' .. vim.fn.fnameescape(root))
+ end,
+ post_case = function()
+ child.stop()
+ end,
+ },
+})
+
+T['public module loads its expected API'] = function()
+ local result = child.lua_func(function()
+ local plugin = require('herdr-splits')
+ local names = {
+ 'setup',
+ 'sync_herdr',
+ 'resize_left',
+ 'resize_down',
+ 'resize_up',
+ 'resize_right',
+ 'move_cursor_left',
+ 'move_cursor_down',
+ 'move_cursor_up',
+ 'move_cursor_right',
+ 'add_ignored_filetype',
+ 'add_ignored_buftype',
+ }
+ local types = {}
+ for _, name in ipairs(names) do
+ types[name] = type(plugin[name])
+ end
+ return types
+ end)
+
+ expect.equality(result, {
+ setup = 'function',
+ sync_herdr = 'function',
+ resize_left = 'function',
+ resize_down = 'function',
+ resize_up = 'function',
+ resize_right = 'function',
+ move_cursor_left = 'function',
+ move_cursor_down = 'function',
+ move_cursor_up = 'function',
+ move_cursor_right = 'function',
+ add_ignored_filetype = 'function',
+ add_ignored_buftype = 'function',
+ })
+end
+
+return T