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

feat: identifier support for subtests #93

Merged
merged 2 commits into from
Jul 19, 2024
Merged
Show file tree
Hide file tree
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
5 changes: 4 additions & 1 deletion lua/dap-go-ts.lua
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,10 @@ local subtests_query = [[
field: (field_identifier) @run)
arguments: (argument_list
(interpreted_string_literal) @testname
(func_literal))
[
(func_literal)
(identifier)
])
(#eq? @run "Run")) @parent
]]

Expand Down
3 changes: 3 additions & 0 deletions tests/go.mod
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
module github.com/leoluz/nvim-dap-go

go 1.22.2
12 changes: 12 additions & 0 deletions tests/subtest_bar_test.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
package tests

import (
"testing"
)

// https://github.com/leoluz/nvim-dap-go/pull/82
func TestWithSubTests(t *testing.T) {
t.Run("subtest with function literal", func(t *testing.T) { t.Fail() })
myFunc := func(t *testing.T) { t.FailNow() }
t.Run("subtest with identifier", myFunc)
}
Loading