]> 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 f234d9b17b95b031d737b70008c49d77b3b425d4..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) {
@@ -69,11 +67,8 @@ 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))
-               }
+                       res := hostInfoRespToGroups(tc.resp)
+                       testutil.AssertEqual(t, "res", res, tc.exp)
                })
        }
 }