@@ -110,8 +110,7 @@ func TestParseGenericsPackageAlias(t *testing.T) {
110110 expected , err := os .ReadFile (filepath .Join (searchDir , "expected.json" ))
111111 assert .NoError (t , err )
112112
113- p := New ()
114- p .ParseDependency = true
113+ p := New (SetParseDependency (true ))
115114 err = p .ParseAPI (searchDir , mainAPIFile , defaultParseDepth )
116115 assert .NoError (t , err )
117116 b , err := json .MarshalIndent (p .swagger , "" , " " )
@@ -133,7 +132,7 @@ func TestParametrizeStruct(t *testing.T) {
133132 Name : & ast.Ident {Name : "Field" },
134133 TypeParams : & ast.FieldList {List : []* ast.Field {{Names : []* ast.Ident {{Name : "T" }}}, {Names : []* ast.Ident {{Name : "T2" }}}}},
135134 Type : & ast.StructType {Struct : 100 , Fields : & ast.FieldList {Opening : 101 , Closing : 102 }},
136- }}, "test.Field[string, []string]" , false )
135+ }}, "test.Field[string, []string]" )
137136 assert .NotNil (t , typeSpec )
138137 assert .Equal (t , "$test.Field-string-array_string" , typeSpec .Name ())
139138 assert .Equal (t , "test.Field-string-array_string" , typeSpec .TypeName ())
@@ -146,7 +145,7 @@ func TestParametrizeStruct(t *testing.T) {
146145 Name : & ast.Ident {Name : "Field" },
147146 TypeParams : & ast.FieldList {List : []* ast.Field {{Names : []* ast.Ident {{Name : "T" }}}}},
148147 Type : & ast.StructType {Struct : 100 , Fields : & ast.FieldList {Opening : 101 , Closing : 102 }},
149- }}, "test.Field[string, string]" , false )
148+ }}, "test.Field[string, string]" )
150149 assert .Nil (t , typeSpec )
151150
152151 // definition contains two type params, but only one is used
@@ -157,7 +156,7 @@ func TestParametrizeStruct(t *testing.T) {
157156 Name : & ast.Ident {Name : "Field" },
158157 TypeParams : & ast.FieldList {List : []* ast.Field {{Names : []* ast.Ident {{Name : "T" }}}, {Names : []* ast.Ident {{Name : "T2" }}}}},
159158 Type : & ast.StructType {Struct : 100 , Fields : & ast.FieldList {Opening : 101 , Closing : 102 }},
160- }}, "test.Field[string]" , false )
159+ }}, "test.Field[string]" )
161160 assert .Nil (t , typeSpec )
162161
163162 // name is not a valid type name
@@ -168,7 +167,7 @@ func TestParametrizeStruct(t *testing.T) {
168167 Name : & ast.Ident {Name : "Field" },
169168 TypeParams : & ast.FieldList {List : []* ast.Field {{Names : []* ast.Ident {{Name : "T" }}}, {Names : []* ast.Ident {{Name : "T2" }}}}},
170169 Type : & ast.StructType {Struct : 100 , Fields : & ast.FieldList {Opening : 101 , Closing : 102 }},
171- }}, "test.Field[string" , false )
170+ }}, "test.Field[string" )
172171 assert .Nil (t , typeSpec )
173172
174173 typeSpec = pd .parametrizeGenericType (
@@ -178,7 +177,7 @@ func TestParametrizeStruct(t *testing.T) {
178177 Name : & ast.Ident {Name : "Field" },
179178 TypeParams : & ast.FieldList {List : []* ast.Field {{Names : []* ast.Ident {{Name : "T" }}}, {Names : []* ast.Ident {{Name : "T2" }}}}},
180179 Type : & ast.StructType {Struct : 100 , Fields : & ast.FieldList {Opening : 101 , Closing : 102 }},
181- }}, "test.Field[string, [string]" , false )
180+ }}, "test.Field[string, [string]" )
182181 assert .Nil (t , typeSpec )
183182
184183 typeSpec = pd .parametrizeGenericType (
@@ -188,7 +187,7 @@ func TestParametrizeStruct(t *testing.T) {
188187 Name : & ast.Ident {Name : "Field" },
189188 TypeParams : & ast.FieldList {List : []* ast.Field {{Names : []* ast.Ident {{Name : "T" }}}, {Names : []* ast.Ident {{Name : "T2" }}}}},
190189 Type : & ast.StructType {Struct : 100 , Fields : & ast.FieldList {Opening : 101 , Closing : 102 }},
191- }}, "test.Field[string, ]string]" , false )
190+ }}, "test.Field[string, ]string]" )
192191 assert .Nil (t , typeSpec )
193192}
194193
0 commit comments