X-Git-Url: https://ruderich.org/simon/gitweb/?a=blobdiff_plain;f=cmd%2Fsafcm%2Fconfig%2Ftriggers_test.go;h=7de0322895ba3e0140cd83a5adacd76fc8f109b4;hb=4299c5d0946ecfa034e9eefe6b16e50bab94a820;hp=96e52d7e7410d2f89707bdb1267ff8436bd5a006;hpb=992eaae7fec45c2d58fff89d1bc0ae920a899296;p=safcm%2Fsafcm.git diff --git a/cmd/safcm/config/triggers_test.go b/cmd/safcm/config/triggers_test.go index 96e52d7..7de0322 100644 --- a/cmd/safcm/config/triggers_test.go +++ b/cmd/safcm/config/triggers_test.go @@ -134,23 +134,22 @@ 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("err = %#v, want nil", err) - } - err = LoadTriggers(tc.group, files) + // 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("err = %#v, want nil", err) + } + err = LoadTriggers(tc.group, files) - if !reflect.DeepEqual(tc.exp, files) { - 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("err = %#v, want %#v", - err, tc.expErr) - } + if !reflect.DeepEqual(tc.exp, files) { + 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("err = %#v, want %#v", + err, tc.expErr) + } }) } }