add TSamLast command for reexecuting last running tests
This commit is contained in:
@@ -67,11 +67,16 @@ local function find_t_runs(lines, func)
|
||||
return subtests
|
||||
end
|
||||
|
||||
local function escape_go_regex(s)
|
||||
s = s or ""
|
||||
return (s:gsub("([\\.^$|()%%[%]{}*+?%-])", "\\\\%1"))
|
||||
end
|
||||
|
||||
local function build_run_pattern(spec)
|
||||
local name = spec.test_path or ""
|
||||
local escaped = name:gsub("(%W)", "%%%1")
|
||||
local escaped = escape_go_regex(name)
|
||||
if spec.scope == "function" then
|
||||
return "^" .. escaped .. "$|^" .. escaped .. "/"
|
||||
return "^" .. escaped .. "($|/)"
|
||||
else
|
||||
return "^" .. escaped .. "$"
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user