Skip to content

Commit 9d0d9f5

Browse files
committed
...
1 parent a243f60 commit 9d0d9f5

File tree

1 file changed

+11
-10
lines changed

1 file changed

+11
-10
lines changed

Tests/RegexBuilderTests/RegexDSLTests.swift

Lines changed: 11 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -984,28 +984,29 @@ class RegexDSLTests: XCTestCase {
984984
@RegexComponentBuilder _ content: () -> some RegexComponent
985985
) {
986986
let regex = content().regex
987+
let result = regex.program.loweredProgram.canOnlyMatchAtStart
987988
print("""
988-
canOnlyMatchAtStart: \(regex.program.loweredProgram.canOnlyMatchAtStart)
989+
canOnlyMatchAtStart: \(result)
989990
expectation: \(expectation)
990-
equal? \(regex.program.loweredProgram.canOnlyMatchAtStart == expectation)
991+
equal? \(result == expectation)
991992
""")
992993

994+
XCTAssertEqual(result ? 1 : 0, expectation ? 1 : 0, file: file, line: line)
995+
993996
if expectation {
994-
XCTAssertTrue(regex.program.loweredProgram.canOnlyMatchAtStart, file: file, line: line)
997+
XCTAssertTrue(result, file: file, line: line)
995998
} else {
996-
XCTAssertFalse(regex.program.loweredProgram.canOnlyMatchAtStart, file: file, line: line)
999+
XCTAssertFalse(result, file: file, line: line)
9971000
}
9981001

999-
XCTAssertTrue(expectation == regex.program.loweredProgram.canOnlyMatchAtStart, file: file, line: line)
1002+
XCTAssertTrue(expectation == result, file: file, line: line)
10001003

1001-
XCTAssertEqual(regex.program.loweredProgram.canOnlyMatchAtStart, expectation, file: file, line: line)
1004+
XCTAssertEqual(result, expectation, file: file, line: line)
10021005
XCTAssertEqual(
1003-
regex.program.loweredProgram.canOnlyMatchAtStart.baseValue,
1006+
result.baseValue,
10041007
expectation.baseValue,
10051008
file: file, line: line)
1006-
print(
1007-
regex.program.loweredProgram.canOnlyMatchAtStart.baseValue,
1008-
expectation.baseValue)
1009+
fflush(stdout)
10091010
}
10101011

10111012
expectCanOnlyMatchAtStart(true) {

0 commit comments

Comments
 (0)