Expose sub-tests

This commit is contained in:
andig 2021-03-09 14:33:53 +01:00
parent 447750b154
commit 9215d4276f
3 changed files with 21 additions and 15 deletions

View file

@ -21,10 +21,12 @@ func TestChargers(t *testing.T) {
}
for _, tmpl := range test.ConfigTemplates("charger") {
_, err := NewFromConfig(tmpl.Type, tmpl.Config)
if err != nil && !test.Acceptable(err, acceptable) {
t.Logf("%s: %+v", tmpl.Name, tmpl.Config)
t.Error(err)
}
t.Run(tmpl.Name, func(t *testing.T) {
_, err := NewFromConfig(tmpl.Type, tmpl.Config)
if err != nil && !test.Acceptable(err, acceptable) {
t.Logf("%s: %+v", tmpl.Name, tmpl.Config)
t.Error(err)
}
})
}
}

View file

@ -17,10 +17,12 @@ func TestMeters(t *testing.T) {
}
for _, tmpl := range test.ConfigTemplates("meter") {
_, err := NewFromConfig(tmpl.Type, tmpl.Config)
if err != nil && !test.Acceptable(err, acceptable) {
t.Logf("%s: %+v", tmpl.Name, tmpl.Config)
t.Error(err)
}
t.Run(tmpl.Name, func(t *testing.T) {
_, err := NewFromConfig(tmpl.Type, tmpl.Config)
if err != nil && !test.Acceptable(err, acceptable) {
t.Logf("%s: %+v", tmpl.Name, tmpl.Config)
t.Error(err)
}
})
}
}

View file

@ -25,10 +25,12 @@ func TestVehicles(t *testing.T) {
}
for _, tmpl := range test.ConfigTemplates("vehicle") {
_, err := NewFromConfig(tmpl.Type, tmpl.Config)
if err != nil && !test.Acceptable(err, acceptable) {
t.Logf("%s: %+v", tmpl.Name, tmpl.Config)
t.Error(err)
}
t.Run(tmpl.Name, func(t *testing.T) {
_, err := NewFromConfig(tmpl.Type, tmpl.Config)
if err != nil && !test.Acceptable(err, acceptable) {
t.Logf("%s: %+v", tmpl.Name, tmpl.Config)
t.Error(err)
}
})
}
}