Skip to content

Commit c171888

Browse files
authored
Remove redundant word from console output for test case started events in verbose mode (#1180)
This is a small fix for an oversight I made in #1125: the word `started` is printed twice at the end of the console message for `.testCaseStarted` events in verbose mode. ### Checklist: - [x] Code and documentation should follow the style of the [Style Guide](https://github.com/apple/swift-testing/blob/main/Documentation/StyleGuide.md). - [x] If public symbols are renamed or modified, DocC references should be updated.
1 parent e895fc8 commit c171888

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)