Skip to content

Commit e34ce43

Browse files
tlivelystanislaw
authored andcommitted
Initially strip only newlines from matched lines
Previously all whitespace was stripped, which caused regex patterns that explicitly checked for whitespace at the end of the line to incorrectly fail.
1 parent 01cc887 commit e34ce43

File tree

4 files changed

+4
-1
lines changed

4 files changed

+4
-1
lines changed

filecheck/filecheck.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -597,7 +597,7 @@ def exit_handler(code):
597597
failed_implicit_check = None
598598

599599
while True:
600-
line = line.rstrip()
600+
line = line.rstrip("\n\r")
601601

602602
unstripped_line = line
603603

Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
CHECK: {{^}}hello {{$}}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
hello
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
RUN: %cat "%S/filecheck.input" | %expect_exit 0 --expect-no-content %FILECHECK_EXEC "%S/filecheck.check"

0 commit comments

Comments
 (0)