X-Git-Url: https://ruderich.org/simon/gitweb/?a=blobdiff_plain;f=cmd%2Fsafcm-remote%2Fsync%2Fservices_systemd_test.go;h=df226fc85e00fae40dc06834e25deae3a1bce5e5;hb=992eaae7fec45c2d58fff89d1bc0ae920a899296;hp=8ba0bfabed44a66e0f4ce787ce658b10b5d2649a;hpb=30df06d9dc760f7adf8ce51f2443dedc773f1350;p=safcm%2Fsafcm.git diff --git a/cmd/safcm-remote/sync/services_systemd_test.go b/cmd/safcm-remote/sync/services_systemd_test.go index 8ba0bfa..df226fc 100644 --- a/cmd/safcm-remote/sync/services_systemd_test.go +++ b/cmd/safcm-remote/sync/services_systemd_test.go @@ -507,9 +507,9 @@ LoadError= } for _, tc := range tests { + t.Run(tc.name, func(t *testing.T) { s, res := prepareSync(tc.req, &testRunner{ t: t, - name: tc.name, expCmds: tc.expCmds, resStdout: tc.stdout, resStderr: tc.stderr, @@ -519,18 +519,19 @@ LoadError= err := s.syncServicesSystemd() // 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) } dbg := res.Wait() if !reflect.DeepEqual(tc.expResp, s.resp) { - t.Errorf("%s: resp: %s", tc.name, + t.Errorf("resp: %s", cmp.Diff(tc.expResp, s.resp)) } if !reflect.DeepEqual(tc.expDbg, dbg) { - t.Errorf("%s: dbg: %s", tc.name, + t.Errorf("dbg: %s", cmp.Diff(tc.expDbg, dbg)) } + }) } }