google / google/assertor

[Feature proposal] Number assertions

Open
#223 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
Rust
Stars
151
Forks
17
PR merge metrics
No merged PRs in 30d

Description

Hi,

I was curious on why there is no implemented assertion for numbers beside `FloatAssertion` which enables precision tolerant assertions. We could have things like `assert_that!(a).is_less_than(b)`, `assert_that(a).is_negative()`, `assert_that(a).is_between(b, c)` etc. I'd be willing to implement some of them for you if you like the idea, but I don't want to invest the time if you do not.

I'm not a big Rust expert (only have one month under my belt), but my thought was that this should be easy to do with macro rules so that we can support all primitive types without much code duplication.

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.