Skip to content

Commit 8df34ba

Browse files
committed
Backtick-aware parsing, rawIdentifierAwareSplit utility
1 parent 892c707 commit 8df34ba

File tree

2 files changed

+5
-10
lines changed

2 files changed

+5
-10
lines changed

Sources/Testing/ABI/EntryPoints/EntryPoint.swift

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,6 @@ func entryPoint(passing args: __CommandLineArguments_v0?, eventHandler: Event.Ha
5959
// Use experimental AdvancedConsoleOutputRecorder
6060
var advancedOptions = Event.AdvancedConsoleOutputRecorder<ABI.HighestVersion>.Options()
6161
advancedOptions.base = Event.ConsoleOutputRecorder.Options.for(.stderr)
62-
6362
let eventRecorder = Event.AdvancedConsoleOutputRecorder<ABI.HighestVersion>(options: advancedOptions) { string in
6463
try? FileHandle.stderr.write(string)
6564
}

Sources/Testing/Events/Recorder/Event.AdvancedConsoleOutputRecorder.swift

Lines changed: 5 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -178,7 +178,7 @@ extension Event.AdvancedConsoleOutputRecorder {
178178

179179
/// Get the tree first branch character (┌─).
180180
private var _treeFirstBranch: String {
181-
_treeCharacter(unicode: "┌─ ", ascii: ".- ")
181+
_treeCharacter(unicode: "┌─ ", ascii: "-- ")
182182
}
183183

184184
/// Get the tree vertical line character (│).
@@ -273,6 +273,7 @@ extension Event.AdvancedConsoleOutputRecorder {
273273
}
274274

275275
/// Parse a test ID into a key path suitable for Graph insertion.
276+
/// Uses existing Test.ID infrastructure and backtick-aware parsing.
276277
///
277278
/// Examples:
278279
/// - "TestingTests.ClockAPITests/testMethod()" -> ["TestingTests", "ClockAPITests", "testMethod()"]
@@ -282,13 +283,8 @@ extension Event.AdvancedConsoleOutputRecorder {
282283
/// - testID: The test ID to parse.
283284
/// - Returns: An array of key path components.
284285
private func _parseTestIDToKeyPath(_ testID: String) -> [String] {
285-
// Swift Testing test IDs include source location information
286-
// We need to extract the logical hierarchy path without source locations
287-
// Examples:
288-
// Suite: "TestingTests.HierarchyDemoTests/NestedSuite"
289-
// Test: "TestingTests.HierarchyDemoTests/failingTest()/HierarchyDemoTests.swift:21:4"
290-
291-
let components = testID.split(separator: "/").map(String.init)
286+
// Use backtick-aware split for proper handling of raw identifiers
287+
let components = rawIdentifierAwareSplit(testID, separator: "/").map(String.init)
292288
var logicalPath: [String] = []
293289

294290
for component in components {
@@ -304,7 +300,7 @@ extension Event.AdvancedConsoleOutputRecorder {
304300
var keyPath: [String] = []
305301

306302
if let firstComponent = logicalPath.first {
307-
let moduleParts = firstComponent.split(separator: ".").map(String.init)
303+
let moduleParts = rawIdentifierAwareSplit(firstComponent, separator: ".").map(String.init)
308304
keyPath.append(contentsOf: moduleParts)
309305

310306
// Add any additional path components (for nested suites)

0 commit comments

Comments
 (0)