]> ruderich.org/simon Gitweb - safcm/safcm.git/blobdiff - cmd/safcm/sync_info_test.go
tests: add and use testutil package to reduce duplication
[safcm/safcm.git] / cmd / safcm / sync_info_test.go
index e01083bb8172b668c95c108fd113232899eff17b..7ad13c9fd01084e6c54c9915cf418b9f9d57e663 100644 (file)
 package main
 
 import (
-       "reflect"
        "testing"
 
-       "github.com/google/go-cmp/cmp"
-
        "ruderich.org/simon/safcm"
+       "ruderich.org/simon/safcm/testutil"
 )
 
 func TestHostInfoRespToGroups(t *testing.T) {
@@ -70,9 +68,7 @@ func TestHostInfoRespToGroups(t *testing.T) {
        for _, tc := range tests {
                t.Run(tc.name, func(t *testing.T) {
                        res := hostInfoRespToGroups(tc.resp)
-                       if !reflect.DeepEqual(tc.exp, res) {
-                               t.Errorf("res: %s", cmp.Diff(tc.exp, res))
-                       }
+                       testutil.AssertEqual(t, "res", res, tc.exp)
                })
        }
 }