Skip to content

Commit 9ebfc4e

Browse files
authored
[6.2] Remove redundant word from console output for test case started events in verbose mode (#1181)
- **Explanation**: This is a small fix for an oversight: the word "started" is printed twice at the end of the console message for `.testCaseStarted` events in verbose mode. - **Scope**: Affects console output in verbose mode. - **Issues**: n/a - **Original PRs**: #1180 - **Risk**: Low - **Testing**: New unit test added - **Reviewers**: @grynspan
1 parent d72cb0a commit 9ebfc4e

File tree

2 files changed

+5
-3
lines changed

2 files changed

+5
-3
lines changed

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

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -521,12 +521,10 @@ extension Event.HumanReadableOutputRecorder {
521521
break
522522
}
523523

524-
let status = verbosity > 0 ? " started" : ""
525-
526524
return [
527525
Message(
528526
symbol: .default,
529-
stringValue: "Test case passing \(arguments.count.counting("argument")) \(testCase.labeledArguments(includingQualifiedTypeNames: verbosity > 0)) to \(testName)\(status) started."
527+
stringValue: "Test case passing \(arguments.count.counting("argument")) \(testCase.labeledArguments(includingQualifiedTypeNames: verbosity > 0)) to \(testName) started."
530528
)
531529
]
532530

Tests/TestingTests/EventRecorderTests.swift

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -113,6 +113,10 @@ struct EventRecorderTests {
113113
#expect(buffer.contains(#"\#(Event.Symbol.details.unicodeCharacter) lhs: Swift.String → "987""#))
114114
#expect(buffer.contains(#""Animal Crackers" (aka 'WrittenTests')"#))
115115
#expect(buffer.contains(#""Not A Lobster" (aka 'actuallyCrab()')"#))
116+
do {
117+
let regex = try Regex(".* Test case passing 1 argument i → 0 \\(Swift.Int\\) to multitudeOcelot\\(i:\\) started.")
118+
#expect(try buffer.split(whereSeparator: \.isNewline).compactMap(regex.wholeMatch(in:)).first != nil)
119+
}
116120
do {
117121
let regex = try Regex(".* Test case passing 1 argument i → 0 \\(Swift.Int\\) to multitudeOcelot\\(i:\\) passed after .*.")
118122
#expect(try buffer.split(whereSeparator: \.isNewline).compactMap(regex.wholeMatch(in:)).first != nil)

0 commit comments

Comments
 (0)