(t *testing.T, got, want *decls.FunctionDecl)
| 1598 | } |
| 1599 | |
| 1600 | func assertFuncEquals(t *testing.T, got, want *decls.FunctionDecl) { |
| 1601 | t.Helper() |
| 1602 | if got.Name() != want.Name() { |
| 1603 | t.Fatalf("got function name %s, wanted %s", got.Name(), want.Name()) |
| 1604 | } |
| 1605 | if len(got.OverloadDecls()) != len(want.OverloadDecls()) { |
| 1606 | t.Fatalf("got overload count %d, wanted %d", len(got.OverloadDecls()), len(want.OverloadDecls())) |
| 1607 | } |
| 1608 | for i, gotOverload := range got.OverloadDecls() { |
| 1609 | wantOverload := want.OverloadDecls()[i] |
| 1610 | if gotOverload.ID() != wantOverload.ID() { |
| 1611 | t.Errorf("got overload id: %s, wanted: %s", gotOverload.ID(), wantOverload.ID()) |
| 1612 | } |
| 1613 | if gotOverload.IsMemberFunction() != wantOverload.IsMemberFunction() { |
| 1614 | t.Errorf("got is member function %t, wanted %t", gotOverload.IsMemberFunction(), wantOverload.IsMemberFunction()) |
| 1615 | } |
| 1616 | if len(gotOverload.ArgTypes()) != len(wantOverload.ArgTypes()) { |
| 1617 | t.Fatalf("got arg count %d, wanted %d", len(gotOverload.ArgTypes()), len(wantOverload.ArgTypes())) |
| 1618 | } |
| 1619 | for i, p := range gotOverload.ArgTypes() { |
| 1620 | wp := wantOverload.ArgTypes()[i] |
| 1621 | if !p.IsExactType(wp) { |
| 1622 | t.Errorf("got arg[%d] type %v, wanted %v", i, p, wp) |
| 1623 | } |
| 1624 | } |
| 1625 | if len(gotOverload.TypeParams()) != len(wantOverload.TypeParams()) { |
| 1626 | t.Fatalf("got type param count %d, wanted %d", len(gotOverload.TypeParams()), len(wantOverload.TypeParams())) |
| 1627 | } |
| 1628 | for i, p := range gotOverload.TypeParams() { |
| 1629 | wp := wantOverload.TypeParams()[i] |
| 1630 | if p != wp { |
| 1631 | t.Errorf("got type param[%d] %s, wanted %s", i, p, wp) |
| 1632 | } |
| 1633 | } |
| 1634 | if !gotOverload.ResultType().IsExactType(wantOverload.ResultType()) { |
| 1635 | t.Errorf("got result type %v, wanted %v", gotOverload.ResultType(), wantOverload.ResultType()) |
| 1636 | } |
| 1637 | if !reflect.DeepEqual(gotOverload.Examples(), wantOverload.Examples()) { |
| 1638 | t.Errorf("got examples %v, wanted %v", gotOverload.Examples(), wantOverload.Examples()) |
| 1639 | } |
| 1640 | } |
| 1641 | } |
| 1642 | |
| 1643 | func unmarshalYAML(t *testing.T, data []byte) *Config { |
| 1644 | t.Helper() |
no test coverage detected