Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion Sources/Exercises/Participants/HandWrittenParticipant.swift
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,8 @@ private func graphemeBreakPropertyData(
}

// For testing our framework
if forceFailure, lower == Unicode.Scalar(0x07FD) {
let failureSigil = Unicode.Scalar(0x07FD as UInt32)!
if forceFailure, lower == failureSigil {
return nil
}

Expand Down
2 changes: 2 additions & 0 deletions Sources/_StringProcessing/Regex/Match.swift
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,8 @@ extension Regex.Match {
from: anyRegexOutput.input
)
guard let output = typeErasedMatch as? Output else {
print(typeErasedMatch)
print(Output.self)
fatalError("Internal error: existential cast failed")
}
return output
Expand Down
13 changes: 6 additions & 7 deletions Tests/RegexBuilderTests/RegexDSLTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -1845,8 +1845,8 @@ extension RegexDSLTests {
}

func testLabeledCaptures_labeledCapture() throws {
guard #available(macOS 13, *) else {
throw XCTSkip("Fix only exists on macOS 13")
guard #available(macOS 14.0, *) else {
throw XCTSkip("Fix only exists on macOS 14")
}
// The output type of a regex with a labeled capture is dropped.
let dslWithLabeledCapture = Regex {
Expand Down Expand Up @@ -1884,8 +1884,8 @@ extension RegexDSLTests {
}

func testLabeledCaptures_bothCapture() throws {
guard #available(macOS 13, *) else {
throw XCTSkip("Fix only exists on macOS 13")
guard #available(macOS 14.0, *) else {
throw XCTSkip("Fix only exists on macOS 14")
}
// Only the output type of a regex with a labeled capture is dropped,
// outputs of other regexes in the same DSL are concatenated.
Expand All @@ -1910,9 +1910,8 @@ extension RegexDSLTests {
}

func testLabeledCaptures_tooManyCapture() throws {
return
guard #available(macOS 13, *) else {
throw XCTSkip("Fix only exists on macOS 13")
guard #available(macOS 14.0, *) else {
throw XCTSkip("Fix only exists on macOS 14")
}
// The output type of a regex with too many captures is dropped.
// "Too many" means the left and right output types would add up to >= 10.
Expand Down