Skip to content

Commit

Permalink
add test for --reject-empty-vars
Browse files Browse the repository at this point in the history
  • Loading branch information
AntonLydike committed Jul 12, 2024
1 parent d5623a6 commit ec3e18d
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions tests/filecheck/diagnostics/reject-empty-vars.test
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
// RUN: strip-comments.sh %s | exfail filecheck %s --reject-empty-vars | filecheck %s --check-prefix DIAG

test 123
// CHECK: test [[VAL:]]
// CHECK-SAME: [[VAL]]

// the warning printed:
// DIAG: Warning: Empty pattern capture
// DIAG-NEXT: Check rule at {{.*}}tests/filecheck/diagnostics/reject-empty-vars.test:4
// DIAG-NEXT: CHECK: test [[VAL:]]
// the error printed:
// DIAG-NEXT: tests/filecheck/diagnostics/reject-empty-vars.test:4: error: Empty value captured for variable "VAL"
// DIAG-NEXT: Matching at <stdin>:1:6
// DIAG-NEXT: test 123
// DIAG-NEXT: {{ }}^

0 comments on commit ec3e18d

Please sign in to comment.