X-Git-Url: https://ruderich.org/simon/gitweb/?a=blobdiff_plain;f=cmd%2Fsafcm%2Fconfig%2Fpermissions_test.go;h=4efefafd2deb9af727d9b08894211ed41c3231f6;hb=992eaae7fec45c2d58fff89d1bc0ae920a899296;hp=cec72a6c8f8106ad2db382b39db46a8e1549a62f;hpb=30df06d9dc760f7adf8ce51f2443dedc773f1350;p=safcm%2Fsafcm.git diff --git a/cmd/safcm/config/permissions_test.go b/cmd/safcm/config/permissions_test.go index cec72a6..4efefaf 100644 --- a/cmd/safcm/config/permissions_test.go +++ b/cmd/safcm/config/permissions_test.go @@ -226,23 +226,24 @@ This is FreeBSD host } for _, tc := range tests { + t.Run(tc.group, func(t *testing.T) { // Use LoadFiles() so we work on real data and don't make any // mistakes generating it files, err := LoadFiles(tc.group) if err != nil { - t.Fatalf("%s: err = %#v, want nil", - tc.group, err) + t.Fatalf("err = %#v, want nil", err) } err = LoadPermissions(tc.group, files) if !reflect.DeepEqual(tc.exp, files) { - t.Errorf("%s: res: %s", tc.group, + t.Errorf("res: %s", cmp.Diff(tc.exp, files)) } // 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.group, err, tc.expErr) + t.Errorf("err = %#v, want %#v", + err, tc.expErr) } + }) } }