-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #64 from stanislaw/develop
CHECK-NOT: edge case: failing CHECK has higher precedence than failing CHECK-NOT
- Loading branch information
Showing
18 changed files
with
194 additions
and
19 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
Known issues | ||
============ | ||
|
||
Unintuitive behavior of CHECK-NOT | ||
--------------------------------- | ||
|
||
A failing CHECK has a higher precedence than a failing CHECK-NOT | ||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ | ||
|
||
A failing `CHECK` has a higher precedence than a failing `CHECK-NOT` even if | ||
`CHECK-NOT` appears first in the check file. If this happens, the output is | ||
related to the failing `CHECK`, not the failing `CHECK-NOT`. | ||
|
||
Input: | ||
|
||
.. code-block:: text | ||
String1 | ||
Stringggg2 | ||
Check file: | ||
|
||
.. code-block:: text | ||
; CHECK-NOT:String1 | ||
; CHECK:String2 | ||
Result: | ||
|
||
.. code-block:: text | ||
/Users/Stanislaw/.pyenv/shims/filecheck | ||
filecheck.check:2:9: error: CHECK: expected string not found in input | ||
; CHECK:String2 | ||
^ | ||
<stdin>:1:1: note: scanning from here | ||
String1 | ||
^ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 2 additions & 0 deletions
2
...s/CHECK-NOT/multiple_strings/01-failing-CHECK-NOT-followed-by-valid-CHECK/filecheck.check
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
; CHECK-NOT:{{.*String1.*}} | ||
; CHECK:String2 |
3 changes: 3 additions & 0 deletions
3
...s/CHECK-NOT/multiple_strings/01-failing-CHECK-NOT-followed-by-valid-CHECK/filecheck.input
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
NOT RELEVANT | ||
String1 | ||
String2 |
9 changes: 9 additions & 0 deletions
9
...ands/CHECK-NOT/multiple_strings/01-failing-CHECK-NOT-followed-by-valid-CHECK/sample.itest
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
; RUN: cat %S/filecheck.input | (%FILECHECK_EXEC %S/filecheck.check 2>&1; test $? = 1;) | %FILECHECK_TESTER_EXEC %s --strict-whitespace --match-full-lines | ||
; CHECK:{{^.*}}FileCheck{{(\.py)?$}} | ||
; CHECK:{{^.*}}:1:13: error: CHECK-NOT: excluded string found in input | ||
; CHECK:{{; CHECK-NOT:..\.\*String1.*..}} | ||
; CHECK:{{^ \^$}} | ||
; CHECK:<stdin>:2:1: note: found here | ||
; CHECK:String1 | ||
; CHECK:^~~~~~~ | ||
; CHECK-EMPTY: |
2 changes: 2 additions & 0 deletions
2
...HECK-NOT/multiple_strings/03-CHECK-NOT-has-no-effect-if-next-CHECK-passed/filecheck.check
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
; CHECK:String2 | ||
; CHECK-NOT:{{.*String1.*}} |
2 changes: 2 additions & 0 deletions
2
...HECK-NOT/multiple_strings/03-CHECK-NOT-has-no-effect-if-next-CHECK-passed/filecheck.input
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
String1 | ||
String2 |
3 changes: 3 additions & 0 deletions
3
...s/CHECK-NOT/multiple_strings/03-CHECK-NOT-has-no-effect-if-next-CHECK-passed/sample.itest
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
; RUN: cat %S/filecheck.input | (%FILECHECK_EXEC %S/filecheck.check 2>&1; test $? = 0;) | %FILECHECK_TESTER_EXEC %s --strict-whitespace --match-full-lines | ||
; CHECK:{{^.*}}FileCheck{{(\.py)?$}} | ||
; CHECK-EMPTY: |
3 changes: 3 additions & 0 deletions
3
...strings/04-when-no-input-anymore-filters-out-CHECK-NOT-but-fails-on-CHECK/filecheck.check
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
; CHECK:String2 | ||
; CHECK-NOT:{{.*String1.*}} | ||
; CHECK:String3 |
2 changes: 2 additions & 0 deletions
2
...strings/04-when-no-input-anymore-filters-out-CHECK-NOT-but-fails-on-CHECK/filecheck.input
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
String1 | ||
String2 |
13 changes: 13 additions & 0 deletions
13
...le_strings/04-when-no-input-anymore-filters-out-CHECK-NOT-but-fails-on-CHECK/sample.itest
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
; RUN: cat %S/filecheck.input | (%FILECHECK_EXEC %S/filecheck.check 2>&1; test $? = 1;) | %FILECHECK_TESTER_EXEC %s --strict-whitespace --match-full-lines | ||
; CHECK:{{^.*}}FileCheck{{(\.py)?$}} | ||
; CHECK:{{^.*}}filecheck.check:3:9: error: CHECK: expected string not found in input{{$}} | ||
; CHECK:; CHECK:String3 | ||
; CHECK: ^ | ||
; TODO: Without --match-full-lines, LLVM FileCheck allows multiple checks on a same line #52 | ||
; TODO: https://github.com/stanislaw/FileCheck.py/issues/52 | ||
; CHECK:{{<stdin>:(1|2):(8|1): note: scanning from here}} | ||
; CHECK:{{.*}} | ||
; CHECK:{{.*^}} | ||
; TODO: "note: possible intended match here" feature: not clear when FileCheck decides to show it or not #63 | ||
; TODO: https://github.com/stanislaw/FileCheck.py/issues/63 | ||
; CHECK-EMPTY |
2 changes: 2 additions & 0 deletions
2
...ple_strings/CHECK-has-a-higher-priority-than-CHECK-NOT/01-minimal-example/filecheck.check
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
; CHECK-NOT:String1 | ||
; CHECK:String2 |
2 changes: 2 additions & 0 deletions
2
...ple_strings/CHECK-has-a-higher-priority-than-CHECK-NOT/01-minimal-example/filecheck.input
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
String1 | ||
Stringggg2 |
11 changes: 11 additions & 0 deletions
11
...ltiple_strings/CHECK-has-a-higher-priority-than-CHECK-NOT/01-minimal-example/sample.itest
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
; RUN: cat %S/filecheck.input | (%FILECHECK_EXEC %S/filecheck.check 2>&1; test $? = 1;) | %FILECHECK_TESTER_EXEC %s --strict-whitespace --match-full-lines | ||
; CHECK:{{^.*}}FileCheck{{(\.py)?$}} | ||
; CHECK:{{^.*}}filecheck.check:2:9: error: CHECK: expected string not found in input | ||
; CHECK:; CHECK:String2 | ||
; CHECK: ^ | ||
; CHECK:<stdin>:1:1: note: scanning from here | ||
; CHECK:String1 | ||
; CHECK:^ | ||
; TODO: Difference in behavior: FileCheck.py prints possible intended match, | ||
; TODO: while FileCheck C++ does not. | ||
; CHECK-EMPTY |
2 changes: 2 additions & 0 deletions
2
...K-has-a-higher-priority-than-CHECK-NOT/02-example-with-placeholder-string/filecheck.check
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
; CHECK-NOT:{{.*String2.*}} | ||
; CHECK:String3 |
3 changes: 3 additions & 0 deletions
3
...K-has-a-higher-priority-than-CHECK-NOT/02-example-with-placeholder-string/filecheck.input
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
String1 | ||
String2 | ||
Stringggg3 |
11 changes: 11 additions & 0 deletions
11
...HECK-has-a-higher-priority-than-CHECK-NOT/02-example-with-placeholder-string/sample.itest
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
; RUN: cat %S/filecheck.input | (%FILECHECK_EXEC %S/filecheck.check 2>&1; test $? = 1;) | %FILECHECK_TESTER_EXEC %s --strict-whitespace --match-full-lines | ||
; CHECK:{{^.*}}FileCheck{{(\.py)?$}} | ||
; CHECK:{{^.*}}:2:9: error: CHECK: expected string not found in input | ||
; CHECK:; CHECK:String3 | ||
; CHECK: ^ | ||
; CHECK:<stdin>:1:1: note: scanning from here | ||
; CHECK:String1 | ||
; CHECK:^ | ||
; TODO: Difference in behavior: FileCheck.py prints possible intended match, | ||
; TODO: while FileCheck C++ does not. | ||
; CHECK-EMPTY |