Subtest debugging #122
Labels
No labels
bug
documentation
duplicate
enhancement
good first issue
help wanted
invalid
question
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
NeonXP/nvim-dap-go#122
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Test functions can use
t.Run()to create individually-addressable subtests. For exampleand we can use
go test -run TestFruit/appleto run only theapplesubtest. When debugging, this is very useful if we don't want to hit breakpoints in all of the other subtests.We can actually get this behavior with nvim-dap-go by abusing
debug_test'scustom_configto override theargs, likebut it would be a lot cleaner if it was integrated into nvim-dap-go directly.
did you consider using neotest golang for that purpose?
it has a dap strategy to run and contains a treesitter query to run an individual subtest.
or you mean this plugin should contain those treesitter queries?
https://github.com/fredrikaverpil/neotest-golang/blob/main/lua/neotest-golang/query.lua
@dennypenta no, I don't mean that. My tests with subtests are mostly table-tests, so a treesitter query looking for
t.Run()with a string literal wouldn't get me anywhere (just like it wouldn't in the example I posted, becausefruitisn't a literal).My suggestion was to have nvim-dap-go prompt for the name of a subtest to run within the currently-selected test — again, just like the example in my issue, only without abusing
debug_test'sargs.