-
Notifications
You must be signed in to change notification settings - Fork 18.7k
Open
Labels
ProposalToolProposalIssues describing a requested change to a Go tool or command-line program.Issues describing a requested change to a Go tool or command-line program.
Milestone
Description
Proposal Details
When writing tests using testing/synctest, I find myself writing very many tests that look like this:
func TestSomething(t *testing.T) {
synctest.Test(t, func(t *testing.T) {
...
})
}
This means that essentially all of my test code has a double level of indentation,
and the synctest wrapper is annoying to write every time.
I wonder if it might be more convenient to have a way to mark
a given test as "synctest" and have the testing package be responsible
for doing the wrapping.
One possibility might be to use a doc-comment-style annotation:
//testing:synctest
func TestSomething(t *testing.T)
This would be picked up by the testing harness and become equivalent
to the earlier TestSomething function.
creachadair and neildtmthrgd, apparentlymart and SimonRichardsonearthboundkid
Metadata
Metadata
Assignees
Labels
ProposalToolProposalIssues describing a requested change to a Go tool or command-line program.Issues describing a requested change to a Go tool or command-line program.