(t *testing.T, got, want *decls.FunctionDecl)
| 1491 | } |
| 1492 | |
| 1493 | func assertFuncEquals(t *testing.T, got, want *decls.FunctionDecl) { |
| 1494 | t.Helper() |
| 1495 | if got.Name() != want.Name() { |
| 1496 | t.Fatalf("got function name %s, wanted %s", got.Name(), want.Name()) |
| 1497 | } |
| 1498 | if len(got.OverloadDecls()) != len(want.OverloadDecls()) { |
| 1499 | t.Fatalf("got overload count %d, wanted %d", len(got.OverloadDecls()), len(want.OverloadDecls())) |
| 1500 | } |
| 1501 | for i, gotOverload := range got.OverloadDecls() { |
| 1502 | wantOverload := want.OverloadDecls()[i] |
| 1503 | if gotOverload.ID() != wantOverload.ID() { |
| 1504 | t.Errorf("got overload id: %s, wanted: %s", gotOverload.ID(), wantOverload.ID()) |
| 1505 | } |
| 1506 | if gotOverload.IsMemberFunction() != wantOverload.IsMemberFunction() { |
| 1507 | t.Errorf("got is member function %t, wanted %t", gotOverload.IsMemberFunction(), wantOverload.IsMemberFunction()) |
| 1508 | } |
| 1509 | if len(gotOverload.ArgTypes()) != len(wantOverload.ArgTypes()) { |
| 1510 | t.Fatalf("got arg count %d, wanted %d", len(gotOverload.ArgTypes()), len(wantOverload.ArgTypes())) |
| 1511 | } |
| 1512 | for i, p := range gotOverload.ArgTypes() { |
| 1513 | wp := wantOverload.ArgTypes()[i] |
| 1514 | if !p.IsExactType(wp) { |
| 1515 | t.Errorf("got arg[%d] type %v, wanted %v", i, p, wp) |
| 1516 | } |
| 1517 | } |
| 1518 | if len(gotOverload.TypeParams()) != len(wantOverload.TypeParams()) { |
| 1519 | t.Fatalf("got type param count %d, wanted %d", len(gotOverload.TypeParams()), len(wantOverload.TypeParams())) |
| 1520 | } |
| 1521 | for i, p := range gotOverload.TypeParams() { |
| 1522 | wp := wantOverload.TypeParams()[i] |
| 1523 | if p != wp { |
| 1524 | t.Errorf("got type param[%d] %s, wanted %s", i, p, wp) |
| 1525 | } |
| 1526 | } |
| 1527 | if !gotOverload.ResultType().IsExactType(wantOverload.ResultType()) { |
| 1528 | t.Errorf("got result type %v, wanted %v", gotOverload.ResultType(), wantOverload.ResultType()) |
| 1529 | } |
| 1530 | } |
| 1531 | } |
| 1532 | |
| 1533 | func unmarshalYAML(t *testing.T, data []byte) *Config { |
| 1534 | t.Helper() |
no test coverage detected