Skip to content

Commit aeb1eb6

Browse files
authored
Merge pull request #73 from CodaFi/negative-nelly
Implement implicit-check-not
2 parents cddd297 + 8c71832 commit aeb1eb6

File tree

3 files changed

+220
-80
lines changed

3 files changed

+220
-80
lines changed
Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
import LLVM
2+
import XCTest
3+
import Foundation
4+
5+
class FileCheckSpec : XCTestCase {
6+
func testImplicitCheckNot() {
7+
XCTAssert(fileCheckOutput(of: .stdout, withPrefixes: ["CHECK-NOTCHECK"]) {
8+
// CHECK-NOTCHECK: error: NOTCHECK-NOT: string occurred!
9+
// CHECK-NOTCHECK-NEXT: warning:
10+
// CHECK-NOTCHECK-NEXT: note: NOTCHECK-NOT: pattern specified here
11+
// CHECK-NOTCHECK-NEXT: IMPLICIT-CHECK-NOT: warning:
12+
XCTAssertFalse(fileCheckOutput(of: .stdout, withPrefixes: ["NOTCHECK"], checkNot: ["warning:"], options: [.disableColors]) {
13+
// NOTCHECK: error:
14+
print("error:")
15+
// NOTCHECK: error:
16+
print("error:")
17+
// NOTCHECK: error:
18+
print("error:")
19+
// NOTCHECK: error:
20+
print("error:")
21+
print("warning:")
22+
})
23+
})
24+
25+
XCTAssert(fileCheckOutput(of: .stdout, withPrefixes: ["CHECK-NOTCHECK-MID"]) {
26+
// CHECK-NOTCHECK-MID: error: NOTCHECK-MID-NOT: string occurred!
27+
// CHECK-NOTCHECK-MID-NEXT: warning:
28+
// CHECK-NOTCHECK-MID-NEXT: note: NOTCHECK-MID-NOT: pattern specified here
29+
// CHECK-NOTCHECK-MID-NEXT: IMPLICIT-CHECK-NOT: warning:
30+
XCTAssertFalse(fileCheckOutput(of: .stdout, withPrefixes: ["NOTCHECK-MID"], checkNot: ["warning:"], options: [.disableColors]) {
31+
// NOTCHECK-MID: error:
32+
print("error:")
33+
// NOTCHECK-MID: error:
34+
print("error:")
35+
print("warning:")
36+
// NOTCHECK-MID: error:
37+
print("error:")
38+
// NOTCHECK-MID: error:
39+
print("error:")
40+
})
41+
})
42+
}
43+
44+
#if !os(macOS)
45+
static var allTests = testCase([
46+
("testImplicitCheckNot", testImplicitCheckNot),
47+
])
48+
#endif
49+
}

0 commit comments

Comments
 (0)