Skip to content

Commit 3c80e1b

Browse files
committed
Fix skeleton implementation based on code review feedback
- Change handle() to record() for consistency with other recorders - Update documentation to use proper DocC reference (Event/ConsoleOutputRecorder) - Remove unused configuration options (useHierarchicalOutput, showSuccessfulTests) - Simplify LiveUpdatingLine documentation - Remove future capability descriptions from main documentation
1 parent 16e581a commit 3c80e1b

File tree

3 files changed

+7
-38
lines changed

3 files changed

+7
-38
lines changed

Sources/Testing/ABI/EntryPoints/EntryPoint.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ func entryPoint(passing args: __CommandLineArguments_v0?, eventHandler: Event.Ha
6565
}
6666

6767
configuration.eventHandler = { [oldEventHandler = configuration.eventHandler] event, context in
68-
eventRecorder.handle(event, in: context)
68+
eventRecorder.record(event, in: context)
6969
oldEventHandler(event, context)
7070
}
7171
} else {

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

Lines changed: 6 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -14,29 +14,14 @@ extension Event {
1414
///
1515
/// This recorder is currently experimental and must be enabled via the
1616
/// `SWT_ENABLE_EXPERIMENTAL_CONSOLE_OUTPUT` environment variable.
17-
///
18-
/// Future capabilities will include:
19-
/// - Hierarchical test result display with tree visualization
20-
/// - Live progress indicators during test execution
21-
/// - Enhanced SF Symbols integration on supported platforms
2217
struct AdvancedConsoleOutputRecorder: Sendable {
2318
/// Configuration options for the advanced console output recorder.
2419
struct Options: Sendable {
2520
/// Base console output recorder options to inherit from.
2621
var base: Event.ConsoleOutputRecorder.Options
2722

28-
/// Whether to enable experimental hierarchical output display.
29-
/// Currently unused - reserved for future PR #2.
30-
var useHierarchicalOutput: Bool
31-
32-
/// Whether to show successful tests in the output.
33-
/// Currently unused - reserved for future PR #2.
34-
var showSuccessfulTests: Bool
35-
3623
init() {
3724
self.base = Event.ConsoleOutputRecorder.Options()
38-
self.useHierarchicalOutput = true
39-
self.showSuccessfulTests = true
4025
}
4126
}
4227

@@ -63,17 +48,16 @@ extension Event {
6348
}
6449

6550
extension Event.AdvancedConsoleOutputRecorder {
66-
/// Handle an event by processing it and generating appropriate output.
51+
/// Record an event by processing it and generating appropriate output.
6752
///
68-
/// Currently this is a skeleton implementation that delegates to the
69-
/// standard ConsoleOutputRecorder.
53+
/// Currently this is a skeleton implementation that delegates to
54+
/// ``Event/ConsoleOutputRecorder``.
7055
///
7156
/// - Parameters:
72-
/// - event: The event to handle.
57+
/// - event: The event to record.
7358
/// - eventContext: The context associated with the event.
74-
func handle(_ event: borrowing Event, in eventContext: borrowing Event.Context) {
75-
// Skeleton implementation: delegate to standard recorder
76-
// Future PRs will add enhanced functionality here
59+
func record(_ event: borrowing Event, in eventContext: borrowing Event.Context) {
60+
// Skeleton implementation: delegate to ConsoleOutputRecorder
7761
_fallbackRecorder.record(event, in: eventContext)
7862
}
7963
}

Sources/Testing/Support/LiveUpdatingLine.swift

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -9,23 +9,8 @@
99
//
1010

1111
/// Prints a string to the console by overwriting the current line without creating a new line.
12-
/// This is ideal for creating single-line, live-updating progress bars or status indicators.
1312
///
1413
/// - Parameter text: The text to display on the current line
15-
///
16-
/// ## Technical Details
17-
/// - Uses carriage return (`\r`) to move cursor to beginning of current line
18-
/// - Uses ANSI escape code (`\u{001B}[2K`) to clear the entire line
19-
/// - Does not append a newline character, allowing the line to be overwritten again
20-
///
21-
/// ## Example Usage
22-
/// ```swift
23-
/// printLiveUpdatingLine("Processing... 25%")
24-
/// // Later...
25-
/// printLiveUpdatingLine("Processing... 50%")
26-
/// // Later...
27-
/// printLiveUpdatingLine("Processing... 100%")
28-
/// ```
2914
public func printLiveUpdatingLine(_ text: String) {
3015
print("\r\u{001B}[2K\(text)", terminator: "")
3116
}

0 commit comments

Comments
 (0)