]> ruderich.org/simon Gitweb - safcm/safcm.git/blobdiff - cmd/safcm/config/templates_test.go
tests: go fmt and rewrap
[safcm/safcm.git] / cmd / safcm / config / templates_test.go
index 6a0182c3be153910f21ef302e4d40f3932e21d41..8097af7312f3891ea2626f435ff4a3933d4cbcef 100644 (file)
@@ -242,24 +242,24 @@ This is GNU/Linux host
        }
 
        for _, tc := range tests {
-               // 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)
-               }
-               err = LoadTemplates(tc.group, files,
-                       host, groups, allHosts, allGroups)
+               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 = LoadTemplates(tc.group, files,
+                               host, groups, allHosts, allGroups)
 
-               if !reflect.DeepEqual(tc.exp, files) {
-                       t.Errorf("%s: res: %s", tc.group,
-                               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)
-               }
+                       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)
+                       }
+               })
        }
 }