Skip to content

Add a static_assert_eq mdtest helper #1719

@dcreager

Description

@dcreager

We have a static_assert function in ty_extensions, which takes in a bool (or a value that can be coerced to a bool). astral-sh/ruff#21743 recently updated several tests to use a static_assert(actual == expected) pattern. If that fails, all that we can show is the value that was expected to be True. @sharkdp suggested an analogous static_assert_eq, which would perform the same test, but which would be able to print out a nicer diagnostic in case the test fails.

Metadata

Metadata

Assignees

No one assigned

    Labels

    internalAn internal refactor or improvementtestingRelated to testing ty itself

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions