Skip to content

Commit 07994b7

Browse files
committed
Update test to include double Optional
1 parent 7443f98 commit 07994b7

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

Tests/RegexBuilderTests/RegexDSLTests.swift

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1979,10 +1979,10 @@ extension RegexDSLTests {
19791979
OneOrMore(.digit)
19801980
} transform: { Int($0)! }
19811981
"/"
1982-
// denominator
1982+
// denominator (modified to test for double optional)
19831983
Capture {
19841984
OneOrMore(.digit)
1985-
} transform: { Int($0)! }
1985+
} transform: { Optional.some(Int($0)) }
19861986
}
19871987

19881988
do {
@@ -1995,7 +1995,7 @@ extension RegexDSLTests {
19951995
XCTAssert(erasedMatch.output[0].type == Substring.self)
19961996
XCTAssert(erasedMatch.output[1].type == Int?.self)
19971997
XCTAssert(erasedMatch.output[2].type == Int.self)
1998-
XCTAssert(erasedMatch.output[3].type == Int.self)
1998+
XCTAssert(erasedMatch.output[3].type == Int??.self)
19991999
}
20002000

20012001
do {
@@ -2007,7 +2007,7 @@ extension RegexDSLTests {
20072007
let erasedMatch = Regex<AnyRegexOutput>.Match(match)
20082008
XCTAssert(erasedMatch.output[0].type == Substring.self)
20092009
XCTAssert(erasedMatch.output[2].type == Int.self)
2010-
XCTAssert(erasedMatch.output[3].type == Int.self)
2010+
XCTAssert(erasedMatch.output[3].type == Int??.self)
20112011

20122012
XCTExpectFailure {
20132013
// `nil` value is interpreted as `Substring?` instead of `Int?`

0 commit comments

Comments
 (0)