Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: remove test suite AST-detection (still in POC) #85

Merged
merged 1 commit into from
Jul 3, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 1 addition & 11 deletions lua/neotest-golang/ast.lua
Original file line number Diff line number Diff line change
Expand Up @@ -27,16 +27,6 @@ function M.detect_tests(file_path)
name: (field_identifier) @test.name (#match? @test.name "^(Test|Example)")) @test.definition
]]

local receiver_method = [[
; query for receiver method, to be used as test suite namespace
(method_declaration
receiver: (parameter_list
(parameter_declaration
; name: (identifier)
type: (pointer_type
(type_identifier) @namespace.name )))) @namespace.definition
]]

local table_tests = [[
;; query for list table tests
(block
Expand Down Expand Up @@ -137,7 +127,7 @@ function M.detect_tests(file_path)
(#eq? @test.key.name @test.key.name1))))))))
]]

local query = test_function .. test_method .. receiver_method .. table_tests
local query = test_function .. test_method .. table_tests
local opts = { nested_tests = true }

---@type neotest.Tree
Expand Down
Loading