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

Add AbstractCharSequenceAssert#doesNotHaveAny(Leading|Trailing)Whitespaces #3433

Closed
onacit opened this issue Apr 19, 2024 · 4 comments
Closed
Assignees
Labels
status: ideal for contribution An issue that a contributor can help us with type: new feature A new feature

Comments

@onacit
Copy link
Contributor

onacit commented Apr 19, 2024

Feature summary

Sometimes, I need to verify that a String shouldn't have any leading/trailing whitespaces which means the trim() or strip() should be applied to the actual value.

Example

String s = parseValue();
assertThat(s)
        .isNotNull()
        .satisfies(v -> {
            assertThat(v.strip()).isEqualTo(v); // any alternatives?
        })
       .doesNotHaveAnyLeadingWhitespaces()
       .doesNotHaveAnyTrailingWhitespaces()
;
@joel-costigliola
Copy link
Member

Could be useful indeed

@joel-costigliola joel-costigliola added status: ideal for contribution An issue that a contributor can help us with type: new feature A new feature labels Apr 19, 2024
@yyytir777
Copy link
Contributor

if you don't mind, may i take it?

@scordio
Copy link
Member

scordio commented Apr 23, 2024

Sure, go for it, @yyytir777!

@yyytir777 yyytir777 removed their assignment Apr 23, 2024
@yyytir777
Copy link
Contributor

could you assign me again? I removed it by mistake..

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
status: ideal for contribution An issue that a contributor can help us with type: new feature A new feature
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants