| ;-------------------------------------------------- |
| ; Use -strict-whitespace to check marker and note alignment here. |
| ; (Also check multiline marker where start/end columns vary across lines.) |
| ; |
| ; In the remaining checks, don't use -strict-whitespace and thus check just the |
| ; presence, order, and lengths of markers. That way, if we ever change padding |
| ; within line labels, we don't have to adjust so many tests. |
| ;-------------------------------------------------- |
| |
| ; RUN: echo 'hello world' > %t.in |
| ; RUN: echo 'goodbye' >> %t.in |
| ; RUN: echo 'world' >> %t.in |
| ; RUN: echo 'unicorn' >> %t.in |
| |
| ; RUN: echo 'CHECK: hello' > %t.chk |
| ; RUN: echo 'CHECK: universe' >> %t.chk |
| |
| ; RUN: not FileCheck -dump-input=always -input-file %t.in %t.chk -v 2>&1 \ |
| ; RUN: | FileCheck -strict-whitespace -match-full-lines -check-prefix=ALIGN %s |
| |
| ; ALIGN:Full input was: |
| ; ALIGN-NEXT:<<<<<< |
| ; ALIGN-NEXT: 1: hello world |
| ; ALIGN-NEXT:check:2'0 X~~~~ |
| ; ALIGN-NEXT: 2: goodbye |
| ; ALIGN-NEXT:check:2'0 ~~~~~~~ |
| ; ALIGN-NEXT: 3: world |
| ; ALIGN-NEXT:check:2'0 ~~~~~ |
| ; ALIGN-NEXT: 4: unicorn |
| ; ALIGN-NEXT:check:2'0 ~~~~~~~ error: no match found |
| ; ALIGN-NEXT:check:2'1 ? possible intended match |
| ; ALIGN-NEXT:>>>>>> |
| ; ALIGN-NOT:{{.}} |
| |
| ;-------------------------------------------------- |
| ; CHECK (also: multi-line search range, fuzzy match) |
| ;-------------------------------------------------- |
| |
| ; Good match and no match. |
| |
| ; RUN: echo 'hello' > %t.in |
| ; RUN: echo 'again' >> %t.in |
| ; RUN: echo 'whirled' >> %t.in |
| |
| ; RUN: echo 'CHECK: hello' > %t.chk |
| ; RUN: echo 'CHECK: world' >> %t.chk |
| |
| ; RUN: not FileCheck -dump-input=always -input-file %t.in %t.chk 2>&1 \ |
| ; RUN: | FileCheck -match-full-lines %s -check-prefix=CHK |
| ; RUN: not FileCheck -dump-input=always -input-file %t.in %t.chk -v 2>&1 \ |
| ; RUN: | FileCheck -match-full-lines %s -check-prefixes=CHK,CHK-V |
| ; RUN: not FileCheck -dump-input=always -input-file %t.in %t.chk -vv 2>&1 \ |
| ; RUN: | FileCheck -match-full-lines %s -check-prefixes=CHK,CHK-V |
| |
| ; CHK: <<<<<< |
| ; CHK-NEXT: 1: hello |
| ; CHK-NEXT: 2: again |
| ; CHK-NEXT: check:2'0 X~~~~ |
| ; CHK-NEXT: 3: whirled |
| ; CHK-NEXT: check:2'0 ~~~~~~~ error: no match found |
| ; CHK-NEXT: check:2'1 ? possible intended match |
| ; CHK-NEXT: >>>>>> |
| ; CHK-NOT: {{.}} |
| |
| ;-------------------------------------------------- |
| ; CHECK-COUNT-<num> |
| ;-------------------------------------------------- |
| |
| ; Good match and no match. |
| |
| ; RUN: echo 'pete' > %t.in |
| ; RUN: echo 'repete' >> %t.in |
| ; RUN: echo 'repeat' >> %t.in |
| |
| ; RUN: echo 'CHECK-COUNT-3: pete' > %t.chk |
| |
| ; RUN: not FileCheck -dump-input=always -input-file %t.in %t.chk 2>&1 \ |
| ; RUN: | FileCheck -match-full-lines %s -check-prefix=CNT |
| ; RUN: not FileCheck -dump-input=always -input-file %t.in %t.chk -v 2>&1 \ |
| ; RUN: | FileCheck -match-full-lines %s -check-prefixes=CNT,CNT-V |
| ; RUN: not FileCheck -dump-input=always -input-file %t.in %t.chk -vv 2>&1 \ |
| ; RUN: | FileCheck -match-full-lines %s -check-prefixes=CNT,CNT-V |
| |
| ; CNT: <<<<<< |
| ; CNT-NEXT: 1: pete |
| ; CNT-NEXT: 2: repete |
| ; CNT-NEXT: 3: repeat |
| ; CNT-NEXT: count:1 X~~~~~ error: no match found |
| ; CNT-NEXT: >>>>>> |
| ; CNT-NOT: {{.}} |
| |
| ;-------------------------------------------------- |
| ; CHECK-NEXT (also: EOF search-range) |
| ;-------------------------------------------------- |
| |
| ; Good match and no match. |
| |
| ; RUN: echo 'hello' > %t.in |
| ; RUN: echo 'again' >> %t.in |
| |
| ; RUN: echo 'CHECK: hello' > %t.chk |
| ; RUN: echo 'CHECK-NEXT: again' >> %t.chk |
| ; RUN: echo 'CHECK-NEXT: world' >> %t.chk |
| |
| ; RUN: not FileCheck -dump-input=always -input-file %t.in %t.chk 2>&1 \ |
| ; RUN: | FileCheck -match-full-lines %s -check-prefix=NXT |
| ; RUN: not FileCheck -dump-input=always -input-file %t.in %t.chk -v 2>&1 \ |
| ; RUN: | FileCheck -match-full-lines %s -check-prefixes=NXT,NXT-V |
| ; RUN: not FileCheck -dump-input=always -input-file %t.in %t.chk -vv 2>&1 \ |
| ; RUN: | FileCheck -match-full-lines %s -check-prefixes=NXT,NXT-V,NXT-VV |
| |
| ; NXT: <<<<<< |
| ; NXT-NEXT: 1: hello |
| ; NXT-NEXT: 2: again |
| ; NXT-NEXT: 3: |
| ; NXT-NEXT: next:3 X error: no match found |
| ; NXT-NEXT: >>>>>> |
| ; NXT-NOT: {{.}} |
| |
| ;-------------------------------------------------- |
| ; CHECK-SAME (also: single-char search range) |
| ;-------------------------------------------------- |
| |
| ; Good match and no match. |
| |
| ; RUN: echo 'hello world!' > %t.in |
| |
| ; RUN: echo 'CHECK: hello' > %t.chk |
| ; RUN: echo 'CHECK-SAME: world' >> %t.chk |
| ; RUN: echo 'CHECK-SAME: again' >> %t.chk |
| |
| ; RUN: not FileCheck -dump-input=always -input-file %t.in %t.chk 2>&1 \ |
| ; RUN: | FileCheck -match-full-lines %s -check-prefix=SAM |
| ; RUN: not FileCheck -dump-input=always -input-file %t.in %t.chk -v 2>&1 \ |
| ; RUN: | FileCheck -match-full-lines %s -check-prefixes=SAM,SAM-V |
| ; RUN: not FileCheck -dump-input=always -input-file %t.in %t.chk -vv 2>&1 \ |
| ; RUN: | FileCheck -match-full-lines %s -check-prefixes=SAM,SAM-V,SAM-VV |
| |
| ; SAM: <<<<<< |
| ; SAM-NEXT: 1: hello world! |
| ; SAM-NEXT: same:3 X error: no match found |
| ; SAM-NEXT: >>>>>> |
| ; SAM-NOT: {{.}} |
| |
| ;-------------------------------------------------- |
| ; CHECK-EMPTY (also: search range ends at label) |
| ;-------------------------------------------------- |
| |
| ; Good match and no match. |
| ; |
| ; CHECK-EMPTY always seems to match an empty line at EOF (illegally when it's |
| ; not the next line) unless either (1) the last line is non-empty and has no |
| ; newline or (2) there's a CHECK-LABEL to end the search range before EOF. We |
| ; choose scenario 2 to check the case of no match. |
| |
| ; RUN: echo 'hello' > %t.in |
| ; RUN: echo '' >> %t.in |
| ; RUN: echo 'world' >> %t.in |
| ; RUN: echo 'label' >> %t.in |
| |
| ; RUN: echo 'CHECK: hello' > %t.chk |
| ; RUN: echo 'CHECK-EMPTY:' >> %t.chk |
| ; RUN: echo 'CHECK-EMPTY:' >> %t.chk |
| ; RUN: echo 'CHECK-LABEL: label' >> %t.chk |
| |
| ; RUN: not FileCheck -dump-input=always -input-file %t.in %t.chk 2>&1 \ |
| ; RUN: | FileCheck -match-full-lines %s -check-prefix=EMP |
| ; RUN: not FileCheck -dump-input=always -input-file %t.in %t.chk -v 2>&1 \ |
| ; RUN: | FileCheck -match-full-lines %s -check-prefixes=EMP,EMP-V |
| ; RUN: not FileCheck -dump-input=always -input-file %t.in %t.chk -vv 2>&1 \ |
| ; RUN: | FileCheck -match-full-lines %s -check-prefixes=EMP,EMP-V,EMP-VV |
| |
| ; EMP: <<<<<< |
| ; EMP-NEXT: 1: hello |
| ; EMP-NEXT: 2: |
| ; EMP-NEXT: 3: world |
| ; EMP-NEXT: empty:3 X~~~~ |
| ; EMP-NEXT: 4: label |
| ; EMP-NEXT: empty:3 ~~~~~ error: no match found |
| ; EMP-NEXT: >>>>>> |
| ; EMP-NOT: {{.}} |
| |
| ;-------------------------------------------------- |
| ; CHECK-DAG |
| ;-------------------------------------------------- |
| |
| ; Good match, discarded match plus good match, and no match. |
| |
| ; RUN: echo 'abc' > %t.in |
| ; RUN: echo 'def' >> %t.in |
| ; RUN: echo 'abc' >> %t.in |
| |
| ; RUN: echo 'CHECK-DAG: def' > %t.chk |
| ; RUN: echo 'CHECK-DAG: abc' >> %t.chk |
| ; RUN: echo 'CHECK-DAG: abc' >> %t.chk |
| ; RUN: echo 'CHECK-DAG: def' >> %t.chk |
| |
| ; RUN: not FileCheck -dump-input=always -input-file %t.in %t.chk 2>&1 \ |
| ; RUN: | FileCheck -match-full-lines %s -check-prefixes=DAG |
| ; RUN: not FileCheck -dump-input=always -input-file %t.in %t.chk -v 2>&1 \ |
| ; RUN: | FileCheck -match-full-lines %s -check-prefixes=DAG |
| ; RUN: not FileCheck -dump-input=always -input-file %t.in %t.chk -vv 2>&1 \ |
| ; RUN: | FileCheck -match-full-lines %s -check-prefixes=DAG |
| |
| ; DAG: <<<<<< |
| ; DAG-NEXT: 1: abc |
| ; DAG-NEXT: 2: def |
| ; DAG-NEXT: 3: abc |
| ; DAG-NEXT: dag:4 X~~ error: no match found |
| ; DAG-NEXT: >>>>>> |
| ; DAG-NOT: {{.}} |
| |
| ;-------------------------------------------------- |
| ; CHECK-LABEL |
| ;-------------------------------------------------- |
| |
| ; Good match and no match. |
| |
| ; RUN: echo 'lab0' > %t.in |
| ; RUN: echo 'foo' >> %t.in |
| ; RUN: echo 'lab1' >> %t.in |
| ; RUN: echo 'bar' >> %t.in |
| |
| ; RUN: echo 'CHECK-LABEL: lab0' > %t.chk |
| ; RUN: echo 'CHECK: foo' >> %t.chk |
| ; RUN: echo 'CHECK-LABEL: lab2' >> %t.chk |
| |
| ; RUN: not FileCheck -dump-input=always -input-file %t.in %t.chk 2>&1 \ |
| ; RUN: | FileCheck -match-full-lines %s -check-prefixes=LAB |
| ; RUN: not FileCheck -dump-input=always -input-file %t.in %t.chk -v 2>&1 \ |
| ; RUN: | FileCheck -match-full-lines %s -check-prefixes=LAB,LAB-V |
| ; RUN: not FileCheck -dump-input=always -input-file %t.in %t.chk -vv 2>&1 \ |
| ; RUN: | FileCheck -match-full-lines %s -check-prefixes=LAB,LAB-V,LAB-VV |
| |
| ; LAB: <<<<<< |
| ; LAB-NEXT: 1: lab0 |
| ; LAB-NEXT: 2: foo |
| ; LAB-NEXT: label:3'0 X~~ |
| ; LAB-NEXT: 3: lab1 |
| ; LAB-NEXT: label:3'0 ~~~~ |
| ; LAB-NEXT: label:3'1 ? possible intended match |
| ; LAB-NEXT: 4: bar |
| ; LAB-NEXT: label:3'0 ~~~ error: no match found |
| ; LAB-NEXT: >>>>>> |
| ; LAB-NOT: {{.}} |
| |
| |