google / google/googletest-rust

provide `between` (or `in_range`) matcher

Open
#677 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
Rust
Stars
432
Forks
36
Avg merge
7d 17h
Merged PRs (30d)
2

Description

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.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.