Skip to content

Unit test type distance #39

@EmileTrotignon

Description

@EmileTrotignon

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.

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions