@@ -140,13 +140,39 @@ class FileCheckSpec : XCTestCase {
140140 } )
141141 }
142142
143+ func testNotDiagInfo( ) {
144+ XCTAssert ( fileCheckOutput ( of: . stdout, withPrefixes: [ " NOTDIAGINFO-TEXT " ] ) {
145+ // NOTDIAGINFO-TEXT: error: NOTDIAGINFO-NOT: string occurred!
146+ // NOTDIAGINFO-TEXT-NEXT: test
147+ // NOTDIAGINFO-TEXT-NEXT: note: NOTDIAGINFO-NOT: pattern specified here
148+ XCTAssertFalse ( fileCheckOutput ( of: . stdout, withPrefixes: [ " NOTDIAGINFO " ] , options: . disableColors) {
149+ // NOTDIAGINFO-NOT: test
150+ print ( " test " )
151+ } )
152+ } )
153+ }
154+
155+ func testNonExistentPrefix( ) {
156+ XCTAssert ( fileCheckOutput ( of: . stdout, withPrefixes: [ " CHECK-NONEXISTENT-PREFIX-ERR " ] ) {
157+ // CHECK-NONEXISTENT-PREFIX-ERR: error: no check strings found with prefixes
158+ // CHECK-NONEXISTENT-PREFIX-ERR-NEXT: CHECK-NONEXISTENT-PREFIX{{:}}
159+ XCTAssertFalse ( fileCheckOutput ( of: . stdout, withPrefixes: [ " CHECK-NONEXISTENT-PREFIX " ] , options: [ . disableColors] ) {
160+ // A-DIFFERENT-PREFIX: foobar
161+ print ( " foobar " )
162+ } )
163+ } )
164+ }
165+
143166 #if !os(macOS)
144167 static var allTests = testCase ( [
145168 ( " testWhitespace " , testWhitespace) ,
146169 ( " testSame " , testSame) ,
170+ ( " testCheckDAG " , testCheckDAG) ,
147171 ( " testImplicitCheckNot " , testImplicitCheckNot) ,
148172 ( " testUndefinedVariablePattern " , testUndefinedVariablePattern) ,
149173 ( " testNearestPattern " , testNearestPattern) ,
174+ ( " testNotDiagInfo " , testNotDiagInfo) ,
175+ ( " testNonExistentPrefix " , testNonExistentPrefix) ,
150176 ] )
151177 #endif
152178}
0 commit comments