diff --git a/lua/gopher/config.lua b/lua/gopher/config.lua index f1cf2ad..32453b9 100644 --- a/lua/gopher/config.lua +++ b/lua/gopher/config.lua @@ -27,6 +27,9 @@ local default_config = { -- path to a directory containing custom test code templates ---@type string|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 gotag = { diff --git a/lua/gopher/gotests.lua b/lua/gopher/gotests.lua index f98b365..0ef52cc 100644 --- a/lua/gopher/gotests.lua +++ b/lua/gopher/gotests.lua @@ -6,6 +6,10 @@ local gotests = {} ---@param args table local function add_test(args) + if c.gotests.named then + table.insert(args, "-named") + end + if c.gotests.template_dir then table.insert(args, "-template_dir") table.insert(args, c.gotests.template_dir)