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

Make custom matcher regexp DOTALL #617

Merged

Conversation

EDbarvinsky
Copy link
Contributor

We have face an issue, that custom matcher fails comparison in case if input parameter contains line terminators.
To make (.*) match everything I suggest to update current regexp to be DOTALL
if you need more appropriate example, please take a look here

@EDbarvinsky
Copy link
Contributor Author

@lukas-krecan review plz :-)

@@ -216,6 +220,13 @@ void shouldSeeExpectedSource() {
assertThat(listener.getExpectedSource(), equalTo(singletonMap("test", "1")));
}

@Test
void shouldMatchWithLineSeparatorCustomMatcher() {
Copy link
Contributor Author

@EDbarvinsky EDbarvinsky Mar 23, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

or would be better to update content of test AllAssertJTest, what do you think?

@lukas-krecan
Copy link
Owner

Looks good, thanks.

I was thinking about an easy way how to apply DOTALL only on the second dot, but it would not be that easy. Actually, the first dot should not have been a dot, but can't change it without breaking backwards compatibility.

@lukas-krecan lukas-krecan merged commit 9f02156 into lukas-krecan:master Mar 23, 2023
@lukas-krecan
Copy link
Owner

Released as 2.37.0

@EDbarvinsky
Copy link
Contributor Author

wow! How fast. Tnx :-)

@EDbarvinsky EDbarvinsky deleted the dotall_custom_matcher_regexp branch March 23, 2023 20:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants