X-Git-Url: https://ruderich.org/simon/gitweb/?a=blobdiff_plain;f=cmd%2Fsafcm%2Fconfig%2Ftriggers_test.go;h=96e52d7e7410d2f89707bdb1267ff8436bd5a006;hb=992eaae7fec45c2d58fff89d1bc0ae920a899296;hp=a27ec6a50902be9d55cfe94147e148540bdd39f5;hpb=30df06d9dc760f7adf8ce51f2443dedc773f1350;p=safcm%2Fsafcm.git diff --git a/cmd/safcm/config/triggers_test.go b/cmd/safcm/config/triggers_test.go index a27ec6a..96e52d7 100644 --- a/cmd/safcm/config/triggers_test.go +++ b/cmd/safcm/config/triggers_test.go @@ -133,23 +133,24 @@ This is FreeBSD host } for _, tc := range tests { + t.Run(tc.group, func(t *testing.T) { // Use LoadFiles() so we work on real data and don't make any // mistakes generating it files, err := LoadFiles(tc.group) if err != nil { - t.Fatalf("%s: err = %#v, want nil", - tc.group, err) + t.Fatalf("err = %#v, want nil", err) } err = LoadTriggers(tc.group, files) if !reflect.DeepEqual(tc.exp, files) { - t.Errorf("%s: res: %s", tc.group, + t.Errorf("res: %s", cmp.Diff(tc.exp, files)) } // Ugly but the simplest way to compare errors (including nil) if fmt.Sprintf("%s", err) != fmt.Sprintf("%s", tc.expErr) { - t.Errorf("%s: err = %#v, want %#v", - tc.group, err, tc.expErr) + t.Errorf("err = %#v, want %#v", + err, tc.expErr) } + }) } }