Go · Concept
Table-driven tests
A table-driven test stores many cases in a table and applies one test body to each case. Named subtests make individual failures easier to find.
Last updated
- Since
- Go 1.7
Syntax
t.Run(name string, f func(t *testing.T)) boolIn-depth API docs are only for subscribers: parameters, examples, common mistakes and interview practice.
SubscribeRelated
testing.T.Runtesting.T.Errorftesting.T.Fatal-runsubtests