Skip to content

Commit

Permalink
Modify last test
Browse files Browse the repository at this point in the history
  • Loading branch information
nielsdebruin committed Dec 10, 2024
1 parent 9bd3ac8 commit 4c375f9
Showing 1 changed file with 22 additions and 3 deletions.
25 changes: 22 additions & 3 deletions rewrite-core/src/test/java/org/openrewrite/text/FindTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -144,6 +144,25 @@ void regexWithoutMultilineAndDotall() {
)
);
}
@Test
void regexMatchingWhitespaceWithoutMultilineWithDotall() {
rewriteRun(
spec -> spec.recipe(new Find("One.Two$", true, true, false, true, null)),
//language=csv
text( // the `.` above matches the space character on the same line
"""
Zero
One Two
Three
""",
"""
Zero
~~>One Two
Three
"""
)
);
}

@Test
void regexWithoutMultilineAndWithDotAll() {
Expand Down Expand Up @@ -197,15 +216,15 @@ void regexWithBothMultilineAndDotAll() {
spec -> spec.recipe(new Find("^This.*below\\.$", true, true, true, true, null)),
text(
"""
This is text.
The first line.
This is a line below.
This is a line above.
This is text.
This is a line below.
""",
"""
~~>This is text.
This is a line below.
The first line.
~~>This is a line below.
This is a line above.
This is text.
This is a line below.
Expand Down

0 comments on commit 4c375f9

Please sign in to comment.