Skip to content

Commit

Permalink
fix: escape regex characters in test name
Browse files Browse the repository at this point in the history
  • Loading branch information
fredrikaverpil committed Jul 5, 2024
1 parent 1b3f1b2 commit 16b1315
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion lua/neotest-golang/runspec_file.lua
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
--- Helpers to build the command and context around running all tests of a file.

local cmd = require("neotest-golang.cmd")
local convert = require("neotest-golang.convert")
local runspec_dir = require("neotest-golang.runspec_dir")

local M = {}
Expand Down Expand Up @@ -93,7 +94,7 @@ function M.get_regexp(filepath)
if line:match("func Test") then
line = line:gsub("func ", "")
line = line:gsub("%(.*", "")
table.insert(lines, line)
table.insert(lines, convert.to_gotest_regex_pattern(line))
end
end
if #lines > 0 then
Expand Down

0 comments on commit 16b1315

Please sign in to comment.