]> ruderich.org/simon Gitweb - safcm/safcm.git/commitdiff
sync: tests: use variable to reduce line wrapping
authorSimon Ruderich <simon@ruderich.org>
Sun, 9 May 2021 10:24:12 +0000 (12:24 +0200)
committerSimon Ruderich <simon@ruderich.org>
Sun, 9 May 2021 13:15:43 +0000 (15:15 +0200)
cmd/safcm-remote/sync/sync_test.go

index 6f8025a2c7cb8d106be7efe23c4efb1b1644e321..52d7435eadcea20abff6fbbc2f9e33639878692d 100644 (file)
@@ -80,10 +80,8 @@ func (r *testRunner) check(method string, cmd *exec.Cmd) (
        exp := r.expCmds[0]
        r.expCmds = r.expCmds[1:]
        if !reflect.DeepEqual(exp, cmd) {
-               r.t.Errorf("%s: %s", method,
-                       cmp.Diff(exp, cmd, cmpopts.IgnoreUnexported(
-                               exec.Cmd{},
-                               bytes.Buffer{})))
+               opts := cmpopts.IgnoreUnexported(exec.Cmd{}, bytes.Buffer{})
+               r.t.Errorf("%s: %s", method, cmp.Diff(exp, cmd, opts))
        }
 
        var stdout, stderr []byte