From 9215d4276f7e243308e63cd06b7bc284e43accb7 Mon Sep 17 00:00:00 2001 From: andig Date: Tue, 9 Mar 2021 14:33:53 +0100 Subject: [PATCH] Expose sub-tests --- charger/config_test.go | 12 +++++++----- meter/config_test.go | 12 +++++++----- vehicle/config_test.go | 12 +++++++----- 3 files changed, 21 insertions(+), 15 deletions(-) diff --git a/charger/config_test.go b/charger/config_test.go index 5994b6892..2c320687a 100644 --- a/charger/config_test.go +++ b/charger/config_test.go @@ -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) + } + }) } } diff --git a/meter/config_test.go b/meter/config_test.go index 41d5eda5a..48d4196e6 100644 --- a/meter/config_test.go +++ b/meter/config_test.go @@ -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) + } + }) } } diff --git a/vehicle/config_test.go b/vehicle/config_test.go index ae70d8245..542be114b 100644 --- a/vehicle/config_test.go +++ b/vehicle/config_test.go @@ -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) + } + }) } }