X-Git-Url: https://ruderich.org/simon/gitweb/?a=blobdiff_plain;f=cmd%2Fsafcm%2Fsync_changes_test.go;h=767564fd14221a2c37405349b9bc867a777cdaa0;hb=992eaae7fec45c2d58fff89d1bc0ae920a899296;hp=f48d441208e5f0bd8dc134b0e42b0a036abe5a00;hpb=30df06d9dc760f7adf8ce51f2443dedc773f1350;p=safcm%2Fsafcm.git diff --git a/cmd/safcm/sync_changes_test.go b/cmd/safcm/sync_changes_test.go index f48d441..767564f 100644 --- a/cmd/safcm/sync_changes_test.go +++ b/cmd/safcm/sync_changes_test.go @@ -283,6 +283,7 @@ func TestFormatFileChanges(t *testing.T) { } for _, tc := range tests { + t.Run(tc.name, func(t *testing.T) { s := &Sync{ config: &config.Config{ DryRun: tc.dryRun, @@ -291,9 +292,10 @@ func TestFormatFileChanges(t *testing.T) { res := s.formatFileChanges(tc.changes) if tc.exp != res { - t.Errorf("%s: res: %s", tc.name, + t.Errorf("res: %s", cmp.Diff(tc.exp, res)) } + }) } } @@ -354,6 +356,7 @@ func TestFormatPackageChanges(t *testing.T) { } for _, tc := range tests { + t.Run(tc.name, func(t *testing.T) { s := &Sync{ config: &config.Config{ DryRun: tc.dryRun, @@ -362,9 +365,10 @@ func TestFormatPackageChanges(t *testing.T) { res := s.formatPackageChanges(tc.changes) if tc.exp != res { - t.Errorf("%s: res: %s", tc.name, + t.Errorf("res: %s", cmp.Diff(tc.exp, res)) } + }) } } @@ -447,6 +451,7 @@ func TestFormatServiceChanges(t *testing.T) { } for _, tc := range tests { + t.Run(tc.name, func(t *testing.T) { s := &Sync{ config: &config.Config{ DryRun: tc.dryRun, @@ -455,9 +460,10 @@ func TestFormatServiceChanges(t *testing.T) { res := s.formatServiceChanges(tc.changes) if tc.exp != res { - t.Errorf("%s: res: %s", tc.name, + t.Errorf("res: %s", cmp.Diff(tc.exp, res)) } + }) } } @@ -657,6 +663,7 @@ func TestFormatCommandChanges(t *testing.T) { } for _, tc := range tests { + t.Run(tc.name, func(t *testing.T) { s := &Sync{ config: &config.Config{ DryRun: tc.dryRun, @@ -666,8 +673,9 @@ func TestFormatCommandChanges(t *testing.T) { res := s.formatCommandChanges(tc.changes) if tc.exp != res { - t.Errorf("%s: res: %s", tc.name, + t.Errorf("res: %s", cmp.Diff(tc.exp, res)) } + }) } }