(t *testing.T, got, want *Config)
| 254 | } |
| 255 | |
| 256 | func assertConfigEquals(t *testing.T, got, want *Config) { |
| 257 | t.Helper() |
| 258 | if err := got.Validate(); err != nil { |
| 259 | t.Errorf("Validate() got %v, wanted nil error", err) |
| 260 | } |
| 261 | if got.Name != want.Name { |
| 262 | t.Errorf("Name got %s, wanted %s", got.Name, want.Name) |
| 263 | } |
| 264 | if got.Description != want.Description { |
| 265 | t.Errorf("Description got %s, wanted %s", got.Description, want.Description) |
| 266 | } |
| 267 | if got.Container != want.Container { |
| 268 | t.Errorf("Container got %s, wanted %s", got.Container, want.Container) |
| 269 | } |
| 270 | if !reflect.DeepEqual(got.Imports, want.Imports) { |
| 271 | t.Errorf("Imports got %v, wanted %v", got.Imports, want.Imports) |
| 272 | } |
| 273 | if !reflect.DeepEqual(got.StdLib, want.StdLib) { |
| 274 | t.Errorf("StdLib got %v, wanted %v", got.StdLib, want.StdLib) |
| 275 | } |
| 276 | if !reflect.DeepEqual(got.Extensions, want.Extensions) { |
| 277 | t.Errorf("Extensions got %v, wanted %v", got.Extensions, want.Extensions) |
| 278 | } |
| 279 | if !reflect.DeepEqual(got.ContextVariable, want.ContextVariable) { |
| 280 | t.Errorf("ContextVariable got %v, wanted %v", got.ContextVariable, want.ContextVariable) |
| 281 | } |
| 282 | if len(got.Variables) != len(want.Variables) { |
| 283 | t.Errorf("Variables count got %d, wanted %d", len(got.Variables), len(want.Variables)) |
| 284 | } else { |
| 285 | for i, v := range got.Variables { |
| 286 | wv := want.Variables[i] |
| 287 | if !reflect.DeepEqual(v, wv) { |
| 288 | t.Errorf("Variables[%d] not equal, got %v, wanted %v", i, v, wv) |
| 289 | } |
| 290 | } |
| 291 | } |
| 292 | if len(got.Functions) != len(want.Functions) { |
| 293 | t.Errorf("Functions count got %d, wanted %d", len(got.Functions), len(want.Functions)) |
| 294 | } else { |
| 295 | for i, f := range got.Functions { |
| 296 | wf := want.Functions[i] |
| 297 | if f.Name != wf.Name { |
| 298 | t.Errorf("Functions[%d] not equal, got %v, wanted %v", i, f.Name, wf.Name) |
| 299 | } |
| 300 | if f.Description != wf.Description { |
| 301 | t.Errorf("Functions[%d] description not equal, got %v, wanted %v", i, f.Description, wf.Description) |
| 302 | } |
| 303 | if len(f.Overloads) != len(wf.Overloads) { |
| 304 | t.Errorf("Function %s got overload count: %d, wanted %d", f.Name, len(f.Overloads), len(wf.Overloads)) |
| 305 | } |
| 306 | for j, o := range f.Overloads { |
| 307 | wo := wf.Overloads[j] |
| 308 | if !reflect.DeepEqual(o, wo) { |
| 309 | t.Errorf("Overload[%d] got %v, wanted %v", j, o, wo) |
| 310 | } |
| 311 | } |
| 312 | } |
| 313 | } |
no test coverage detected