X-Git-Url: https://ruderich.org/simon/gitweb/?a=blobdiff_plain;f=cmd%2Fsafcm%2Fsync_sync_test.go;h=65a490a298518963326cf3597fd720e4e82ddbc0;hb=992eaae7fec45c2d58fff89d1bc0ae920a899296;hp=f6aafd52445e6664f4958ab82703736a51e93982;hpb=30df06d9dc760f7adf8ce51f2443dedc773f1350;p=safcm%2Fsafcm.git diff --git a/cmd/safcm/sync_sync_test.go b/cmd/safcm/sync_sync_test.go index f6aafd5..65a490a 100644 --- a/cmd/safcm/sync_sync_test.go +++ b/cmd/safcm/sync_sync_test.go @@ -419,6 +419,7 @@ func TestHostSyncReq(t *testing.T) { } for _, tc := range tests { + t.Run(tc.name, func(t *testing.T) { err = os.Chdir(filepath.Join(cwd, "testdata", tc.project)) if err != nil { t.Fatal(err) @@ -469,21 +470,21 @@ func TestHostSyncReq(t *testing.T) { res, err := s.hostSyncReq(tc.detected) if !reflect.DeepEqual(tc.exp, res) { - t.Errorf("%s: res: %s", tc.name, + t.Errorf("res: %s", cmp.Diff(tc.exp, res)) } // 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.name, err, tc.expErr) + t.Errorf("err = %#v, want %#v", + err, tc.expErr) } close(ch) <-done if !reflect.DeepEqual(tc.expEvents, events) { - t.Errorf("%s: events: %s", tc.name, + t.Errorf("events: %s", cmp.Diff(tc.expEvents, events)) } - + }) } }