From 49929db247067429196e9a61532b6e318691c2f0 Mon Sep 17 00:00:00 2001 From: zhaogangang <44504986+zhaogangang@users.noreply.github.com> Date: Fri, 24 Feb 2023 14:23:09 +0800 Subject: [PATCH] fix:go unit test flag "-run" not "-r" (#302) * fix:go unit test flag "-run" not "-r" * fix:just consider not use floaterm * chores --------- Co-authored-by: zhaogang --- lua/go/gotest.lua | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/lua/go/gotest.lua b/lua/go/gotest.lua index e9e5f9b..cb82ef0 100644 --- a/lua/go/gotest.lua +++ b/lua/go/gotest.lua @@ -375,6 +375,7 @@ local function run_tests_with_ts_node(args, func_node, tblcase_ns) if run_in_floaterm then table.insert(cmd, test_runner) table.insert(cmd, 'test') + run_flags = '-run' end if optarg['s'] then @@ -584,7 +585,12 @@ M.test_file = function(...) table.insert(cmd_args, '-C') table.insert(cmd_args, optarg['C']) end - table.insert(cmd_args, '-r') + + if run_in_floaterm then + table.insert(cmd_args, '-run') + else + table.insert(cmd_args, '-r') + end tests = "'" .. tests .. "'" table.insert(cmd_args, tests) -- shell script | is a pipe