Skip to content

provide between (or in_range) matcher #677

@rursprung

Description

@rursprung

it'd be nice if there were a matcher to say that a number must be within a specific range, i.e. $x \in [a, b]$.

this is mainly a convenience function as it can also be achieved like this: expect_that!(x, some(all!(ge(a), le(b))));

open point: should it be inclusive on both ends ($x \in [a, b]$) or exclusive ($x \in ]a, b[$)? my vote would be for inclusive; alternatively it could take a boolean parameter to specify this? if someone wants one end open and another closed they can always do it manually as per the current manual workaround.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions