fix(git/status_view): scope dispatch to current tabpage + test cleanup
This commit is contained in:
+11
-5
@@ -1,4 +1,7 @@
|
||||
local cfg = vim.fn.stdpath("config")
|
||||
if type(cfg) == "table" then
|
||||
cfg = assert(cfg[1])
|
||||
end
|
||||
package.path = package.path
|
||||
.. (";" .. cfg .. "/lua/?.lua")
|
||||
.. (";" .. cfg .. "/lua/?/init.lua")
|
||||
@@ -14,6 +17,8 @@ end
|
||||
|
||||
local t = require("test")
|
||||
|
||||
---@param target string
|
||||
---@return string[]?
|
||||
local function gather(target)
|
||||
local abs = vim.fn.fnamemodify(target, ":p")
|
||||
if vim.fn.isdirectory(abs) == 1 then
|
||||
@@ -24,9 +29,8 @@ local function gather(target)
|
||||
end
|
||||
end
|
||||
|
||||
local args = arg or {}
|
||||
local targets = #args > 0 and args or { cfg .. "/test" }
|
||||
|
||||
local targets = (arg and #arg > 0) and arg or { cfg .. "/test" }
|
||||
---@type string[]
|
||||
local files = {}
|
||||
local resolve_failed = false
|
||||
for _, target in ipairs(targets) do
|
||||
@@ -44,8 +48,10 @@ table.sort(files)
|
||||
|
||||
local total_passed, total_failed = 0, 0
|
||||
for _, f in ipairs(files) do
|
||||
f = f --[[@as string]]
|
||||
local label = f:sub(1, #cfg + 1) == cfg .. "/" and f:sub(#cfg + 2) or f
|
||||
local label = f
|
||||
if f:sub(1, #cfg + 1) == cfg .. "/" then
|
||||
label = f:sub(#cfg + 2)
|
||||
end
|
||||
t.start_file(label)
|
||||
local ok, err = pcall(dofile, f)
|
||||
if not ok then
|
||||
|
||||
Reference in New Issue
Block a user