Skip to content

Commit c61cfdd

Browse files
perf: check test file suffix before the go env lookup (#593)
1 parent 272cc53 commit c61cfdd

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

‎lua/neotest-golang/init.lua‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -95,13 +95,13 @@ end
9595
--- @param file_path string
9696
--- @return boolean
9797
function M.Adapter.is_test_file(file_path)
98-
if not go_available() then
98+
if not vim.endswith(file_path, "_test.go") then
9999
return false
100100
end
101-
if lib.goenv.should_skip(file_path, vim.uv.cwd()) then
101+
if not go_available() then
102102
return false
103103
end
104-
return vim.endswith(file_path, "_test.go")
104+
return not lib.goenv.should_skip(file_path, vim.uv.cwd())
105105
end
106106

107107
--- Given a file path, parse all the tests within it.

0 commit comments

Comments
 (0)