You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The query/type_distance.ml does complicated things that should be unit tested.
The unit test framework is alcotest. You can file examples of its uses in query/test, which is also the directory where you should write the new tests.
To test this, you should write by hand a few values of Db.Typexpr.t, compute their distance and write the value you get as the expected value.
Some of the types tested should be similar, so that the distance is small, because the type distance function is going to be used on similar types.
You should also test that the distance of a type with itself is 0.
You can also use Query.Private.Type_parser.of_string to get types from strings, instead of writing them as ocaml values.
The text was updated successfully, but these errors were encountered:
The query/type_distance.ml does complicated things that should be unit tested.
The unit test framework is alcotest. You can file examples of its uses in query/test, which is also the directory where you should write the new tests.
To test this, you should write by hand a few values of
Db.Typexpr.t
, compute their distance and write the value you get as the expected value.Some of the types tested should be similar, so that the distance is small, because the type distance function is going to be used on similar types.
You should also test that the distance of a type with itself is 0.
You can also use
Query.Private.Type_parser.of_string
to get types from strings, instead of writing them as ocaml values.The text was updated successfully, but these errors were encountered: