Skip to content

Range matching #6

@slinkydeveloper

Description

@slinkydeveloper

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions