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

Range matching #6

Open
slinkydeveloper opened this issue Mar 21, 2022 · 0 comments
Open

Range matching #6

slinkydeveloper opened this issue Mar 21, 2022 · 0 comments
Labels
enhancement New feature or request good first issue Good for newcomers

Comments

@slinkydeveloper
Copy link
Collaborator

Right now we convert expressions like:

assertTrue(a < 100 && a > 20);

as

assertThat(a < 100 && a > 20).isTrue();

Without doing any kind of crazy magic, I think for trivial cases like this one we can convert to:

assertThat(a).isStrictly(20, 100);

Or, in cases like:

assertTrue(a < 100 && a >= 20);

We could do:

assertThat(a).isLessThan(100).isGreaterThanOrEqualTo(20);

This should be implemented here among the predicate migrations https://github.com/assertj/assertj-migrator/blob/main/src/main/java/com/slinkydeveloper/assertjmigrator/migrations/common/PredicateMigrator.java

@slinkydeveloper slinkydeveloper added enhancement New feature or request good first issue Good for newcomers labels Mar 21, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request good first issue Good for newcomers
Projects
None yet
Development

No branches or pull requests

1 participant