diff options
| author | Jackson Moore <jacksonmoore@tuta.io> | 2026-09-04 17:46:24 +0200 |
|---|---|---|
| committer | Jackson Moore <jacksonmoore@tuta.io> | 2026-09-04 17:46:24 +0200 |
| commit | ae503e9498553d50cc145d26f4b3457276fc14ba (patch) | |
| tree | ee8793df7baa4503dcfa13ee342a4e875e65d0d9 /tests/plugin_smoke.lua | |
| parent | 3ef0616d516d8c8059380566a29852474d95e801 (diff) | |
Share test assertion helpers
Diffstat (limited to 'tests/plugin_smoke.lua')
| -rw-r--r-- | tests/plugin_smoke.lua | 16 |
1 files changed, 3 insertions, 13 deletions
diff --git a/tests/plugin_smoke.lua b/tests/plugin_smoke.lua index 3028723..c422490 100644 --- a/tests/plugin_smoke.lua +++ b/tests/plugin_smoke.lua @@ -2,19 +2,9 @@ local script = debug.getinfo(1, "S").source:sub(2) local root = script:match("^(.*)/tests/plugin_smoke%.lua$") or "." vim.opt.runtimepath:prepend(root) -local function same(expected, actual, message) - if expected ~= actual then - error((message or "values differ") - .. ": expected " .. tostring(expected) - .. ", got " .. tostring(actual), 2) - end -end - -local function truthy(value, message) - if not value then - error(message or "value must be true", 2) - end -end +local assertions = dofile(root .. "/tests/assertions.lua") +local same = assertions.same +local truthy = assertions.truthy local function feed(keys) vim.api.nvim_feedkeys(vim.keycode(keys), "xt", false) |
