Skip to content

Commit

Permalink
rename test struct
Browse files Browse the repository at this point in the history
  • Loading branch information
schmurfy committed Mar 13, 2024
1 parent 5f963dd commit 49607aa
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions schema/schema_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ var _ shared.EnumResolverInterface = &TestEnumResolver{}
var _ shared.SchemaResolverInterface = &TestEnumResolver{}

func (e *TestEnumResolver) EnumResolver(t reflect.Type) (bool, shared.Enum) {
if t.Name() == "UserSex" {
if t.Name() == "UserGender" {
return true, []shared.EnumEntry{
{Title: "NOT_SET", Value: 0},
{Title: "MALE", Value: 1},
Expand Down Expand Up @@ -195,7 +195,7 @@ func TestSchema(t *testing.T) {
})

g.Describe("structures", func() {
type UserSex int
type UserGender int
type WrappedTime struct {
time.Time
}
Expand All @@ -206,7 +206,7 @@ func TestSchema(t *testing.T) {
Name string `json:"name,omitempty"`
Age int
Ignored bool `json:"-"`
Sex UserSex
Sex UserGender
Time WrappedTime `chipi:"as:datetime"`
Duration WrappedDuration `chipi:"as:duration"`
}
Expand Down Expand Up @@ -273,11 +273,11 @@ func TestSchema(t *testing.T) {
},
"Time": {"format":"date-time", "type":"string"},
"Duration": {"format":"int64", "type":"integer"},
"Sex": {"$ref":"#/components/schemas/schema.UserSex"}
"Sex": {"$ref":"#/components/schemas/schema.UserGender"}
}
}`, string(data))

ref, err := json.Marshal(doc.Components.Schemas["schema.UserSex"])
ref, err := json.Marshal(doc.Components.Schemas["schema.UserGender"])
require.NoError(g, err)
assert.JSONEq(g, `{
"type": "integer",
Expand Down Expand Up @@ -320,7 +320,7 @@ func TestSchema(t *testing.T) {
"type": "integer",
"format": "int64"
},
"Sex": {"$ref":"#/components/schemas/schema.UserSex"},
"Sex": {"$ref":"#/components/schemas/schema.UserGender"},
"Time": {"format":"date-time", "type":"string"},
"Duration": {"format":"int64", "type":"integer"}
}
Expand Down

0 comments on commit 49607aa

Please sign in to comment.