feat: add support for named tests
This commit is contained in:
parent
5592deba21
commit
d5ff2a74fe
2 changed files with 7 additions and 0 deletions
|
|
@ -27,6 +27,9 @@ local default_config = {
|
||||||
-- path to a directory containing custom test code templates
|
-- path to a directory containing custom test code templates
|
||||||
---@type string|nil
|
---@type string|nil
|
||||||
template_dir = nil,
|
template_dir = nil,
|
||||||
|
-- switch table tests from using slice to map (with test name for the key)
|
||||||
|
---@type boolean
|
||||||
|
named = false,
|
||||||
},
|
},
|
||||||
---@class gopher.ConfigGoTag
|
---@class gopher.ConfigGoTag
|
||||||
gotag = {
|
gotag = {
|
||||||
|
|
|
||||||
|
|
@ -6,6 +6,10 @@ local gotests = {}
|
||||||
|
|
||||||
---@param args table
|
---@param args table
|
||||||
local function add_test(args)
|
local function add_test(args)
|
||||||
|
if c.gotests.named then
|
||||||
|
table.insert(args, "-named")
|
||||||
|
end
|
||||||
|
|
||||||
if c.gotests.template_dir then
|
if c.gotests.template_dir then
|
||||||
table.insert(args, "-template_dir")
|
table.insert(args, "-template_dir")
|
||||||
table.insert(args, c.gotests.template_dir)
|
table.insert(args, c.gotests.template_dir)
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue