@@ -151,8 +151,8 @@ func TestOpenAPI_Regex(t *testing.T) {
151151
152152func TestOpenAPI_ExpandPattern (t * testing.T ) {
153153 tests := []struct {
154- in_pattern string
155- out_pathlets []string
154+ inPattern string
155+ outPathlets []string
156156 }{
157157 {"rekey/backup" , []string {"rekey/backup" }},
158158 {"rekey/backup$" , []string {"rekey/backup" }},
@@ -203,10 +203,10 @@ func TestOpenAPI_ExpandPattern(t *testing.T) {
203203 }
204204
205205 for i , test := range tests {
206- out := expandPattern (test .in_pattern )
206+ out := expandPattern (test .inPattern )
207207 sort .Strings (out )
208- if ! reflect .DeepEqual (out , test .out_pathlets ) {
209- t .Fatalf ("Test %d: Expected %v got %v" , i , test .out_pathlets , out )
208+ if ! reflect .DeepEqual (out , test .outPathlets ) {
209+ t .Fatalf ("Test %d: Expected %v got %v" , i , test .outPathlets , out )
210210 }
211211 }
212212}
@@ -266,7 +266,10 @@ func TestOpenAPI_SpecialPaths(t *testing.T) {
266266 Root : test .rootPaths ,
267267 Unauthenticated : test .unauthPaths ,
268268 }
269- documentPath (& path , sp , logical .TypeLogical , doc )
269+ err := documentPath (& path , sp , logical .TypeLogical , doc )
270+ if err != nil {
271+ t .Fatal (err )
272+ }
270273 result := test .root
271274 if doc .Paths ["/" + test .pattern ].Sudo != result {
272275 t .Fatalf ("Test (root) %d: Expected %v got %v" , i , test .root , result )
@@ -288,11 +291,11 @@ func TestOpenAPI_Paths(t *testing.T) {
288291 Pattern : "lookup/" + GenericNameRegex ("id" ),
289292
290293 Fields : map [string ]* FieldSchema {
291- "id" : & FieldSchema {
294+ "id" : {
292295 Type : TypeString ,
293296 Description : "My id parameter" ,
294297 },
295- "token" : & FieldSchema {
298+ "token" : {
296299 Type : TypeString ,
297300 Description : "My token" ,
298301 },
@@ -442,8 +445,14 @@ func TestOpenAPI_OperationID(t *testing.T) {
442445
443446 for _ , context := range []string {"" , "bar" } {
444447 doc := NewOASDocument ()
445- documentPath (path1 , nil , logical .TypeLogical , doc )
446- documentPath (path2 , nil , logical .TypeLogical , doc )
448+ err := documentPath (path1 , nil , logical .TypeLogical , doc )
449+ if err != nil {
450+ t .Fatal (err )
451+ }
452+ err = documentPath (path2 , nil , logical .TypeLogical , doc )
453+ if err != nil {
454+ t .Fatal (err )
455+ }
447456 doc .CreateOperationIDs (context )
448457
449458 tests := []struct {
@@ -500,7 +509,10 @@ func TestOpenAPI_CustomDecoder(t *testing.T) {
500509 }
501510
502511 docOrig := NewOASDocument ()
503- documentPath (p , nil , logical .TypeLogical , docOrig )
512+ err := documentPath (p , nil , logical .TypeLogical , docOrig )
513+ if err != nil {
514+ t .Fatal (err )
515+ }
504516
505517 docJSON := mustJSONMarshal (t , docOrig )
506518
0 commit comments