Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

New matchers to compare easily a number with another one #235

Open
baudoliver7 opened this issue Feb 22, 2021 · 7 comments
Open

New matchers to compare easily a number with another one #235

baudoliver7 opened this issue Feb 22, 2021 · 7 comments

Comments

@baudoliver7
Copy link
Contributor

baudoliver7 commented Feb 22, 2021

We notice many times that we need to compare a number with another one. Currently, outside of static methods of Hamcrest (greaterThan, lessThan), the more easy way to do this is to use Verifies like this :

new Satisfies(x -> x > 0)

It would be very useful to introduce some new matchers to make this kind of assertions more expressive :

  • IsGreaterThan
  • IsGreaterThanOrEqualTo
  • IsLessThan
  • IsLessThanOrEqualTo
@victornoel
Copy link
Collaborator

victornoel commented Feb 22, 2021

@baudoliver7 thx and also let's note that those matcher should implement Matcher<Number> IMHO

@victornoel
Copy link
Collaborator

@0crat in

@andreoss
Copy link
Contributor

andreoss commented May 3, 2021

@victornoel Why not Matcher<Comparable<?>>?

@victornoel
Copy link
Collaborator

@andreoss yes, that would make sense, or Matcher<Comparable<? extends T>> (or would that be super? I think both would work actually here ^^). Let's note that even though Number does not implement Comparable, all its subclasses do. But in cactoos, the Number implementation must be wrapped in ComparableNumber though (it's not yet implemented but will be part of yegor256/cactoos#1587)

andreoss added a commit to andreoss/cactoos-matchers that referenced this issue May 9, 2021
andreoss added a commit to andreoss/cactoos-matchers that referenced this issue May 9, 2021
andreoss added a commit to andreoss/cactoos-matchers that referenced this issue May 9, 2021
andreoss added a commit to andreoss/cactoos-matchers that referenced this issue May 9, 2021
@victornoel
Copy link
Collaborator

@0crat assign @andreoss

andreoss added a commit to andreoss/cactoos-matchers that referenced this issue May 14, 2021
andreoss added a commit to andreoss/cactoos-matchers that referenced this issue May 14, 2021
@victornoel
Copy link
Collaborator

@0crat status

@0crat
Copy link
Collaborator

0crat commented Jun 10, 2021

@0crat status (here)

@victornoel This is what I know about this job in C63314D6Z, as in §32:

  • The job #235 is in scope for 4mon
  • The role is DEV
  • The job is not assigned to anyone
  • The budget is not set yet
  • These users are banned and won't be assigned:
  • Job footprint (restricted area)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants