@@ -20,7 +20,7 @@ func TestJTDInfer(t *testing.T) {
2020 "hobbies" : {Elements : & Schema {Type : jtd .TypeString }},
2121 },
2222 }
23- gotSchema := InferStrings (rows , Hints {}) .IntoSchema (Hints {} )
23+ gotSchema := InferStrings (rows , WithoutHints ()) .IntoSchema ()
2424
2525 assert .EqualValues (t , expectedSchema , gotSchema )
2626}
@@ -48,10 +48,19 @@ func TestJTDInferrerWithEnumHints(t *testing.T) {
4848 },
4949 },
5050 }
51- gotSchema := InferStrings (rows , hints ).IntoSchema (hints )
51+ gotSchema := InferStrings (rows , hints ).IntoSchema ()
5252
5353 // We check that we got the same elements in our enum first and then we
5454 // delete it since the order is unreliable due to being a map.
55+ require .ElementsMatch (
56+ t ,
57+ expectedSchema .Properties ["name" ].Enum ,
58+ gotSchema .Properties ["name" ].Enum ,
59+ )
60+
61+ delete (expectedSchema .Properties , "name" )
62+ delete (gotSchema .Properties , "name" )
63+
5564 require .ElementsMatch (
5665 t ,
5766 expectedSchema .Properties ["address" ].Properties ["city" ].Enum ,
@@ -81,7 +90,7 @@ func TestJTDInferWithValuesHints(t *testing.T) {
8190 },
8291 },
8392 }
84- gotSchema := InferStrings (rows , hints ).IntoSchema (hints )
93+ gotSchema := InferStrings (rows , hints ).IntoSchema ()
8594
8695 assert .EqualValues (t , expectedSchema , gotSchema )
8796}
@@ -112,7 +121,7 @@ func TestJTDInferWithDiscriminatorHints(t *testing.T) {
112121 },
113122 },
114123 }
115- gotSchema := InferStrings (rows , hints ).IntoSchema (hints )
124+ gotSchema := InferStrings (rows , hints ).IntoSchema ()
116125
117126 assert .EqualValues (t , expectedSchema , gotSchema )
118127}
0 commit comments