Organize framework unit tests in subtests

This commit is contained in:
drfish
2021-01-30 12:29:26 +08:00
parent 24f13032b3
commit 0c3d8b9720
8 changed files with 194 additions and 146 deletions

View File

@@ -635,8 +635,10 @@ func TestValidateFitArgs(t *testing.T) {
}
for _, test := range argsTest {
if err := validateFitArgs(test.args); err != nil && !strings.Contains(err.Error(), test.expect) {
t.Errorf("case[%v]: error details do not include %v", test.name, err)
}
t.Run(test.name, func(t *testing.T) {
if err := validateFitArgs(test.args); err != nil && !strings.Contains(err.Error(), test.expect) {
t.Errorf("case[%v]: error details do not include %v", test.name, err)
}
})
}
}