Skip to content

Better tools for testing Ord and VersionSet #113

@Eh2406

Description

@Eh2406
Member

Mostly a follow-up to this comment:
#108 (comment)

But we should provide some way for a user to run "all the tests we can think of" on their types. Not only that we should be using those tests on our types. And they should be documented in the user guide.

May be functions like tests_on_a_version<VS: VersionSet>(v: VS::V) , tests_on_two_versions<VS: VersionSet>(v1: VS::V, v2: VS::V), tests_on_a_set<VS: VersionSet>(vs: VS), etc. that panic if they find a property that doesn't hold. On the other hand that doesn't give a good error message about which property didn't hold.

So maybe a set of functions not_contained_in_empty<VS: VersionSet>(v: VS::V), contained_in_full<VS: VersionSet>(v: VS::V), etc. that panic if a particular property is violated. But then it can be annoying for our users to make one test per property. Maybe we can solve this with a macro somehow?

Activity

added this to the v0.3 milestone on May 27, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

      Development

      No branches or pull requests

        Participants

        @Eh2406

        Issue actions

          Better tools for testing `Ord` and `VersionSet` · Issue #113 · pubgrub-rs/pubgrub