google / google/googletest-rust
provide `between` (or `in_range`) matcher
Open
- 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
Assessment
This issue has not been assessed yet.