From bebd6a42d379a23b23854a00fd92ba0f53157b9d Mon Sep 17 00:00:00 2001 From: Stuart Montgomery Date: Thu, 26 Jun 2025 14:04:56 -0500 Subject: [PATCH] [6.2] Remove redundant word from console output for test case started events in verbose mode --- .../Events/Recorder/Event.HumanReadableOutputRecorder.swift | 4 +--- Tests/TestingTests/EventRecorderTests.swift | 4 ++++ 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/Sources/Testing/Events/Recorder/Event.HumanReadableOutputRecorder.swift b/Sources/Testing/Events/Recorder/Event.HumanReadableOutputRecorder.swift index a3d121e09..248bb4aec 100644 --- a/Sources/Testing/Events/Recorder/Event.HumanReadableOutputRecorder.swift +++ b/Sources/Testing/Events/Recorder/Event.HumanReadableOutputRecorder.swift @@ -521,12 +521,10 @@ extension Event.HumanReadableOutputRecorder { break } - let status = verbosity > 0 ? " started" : "" - return [ Message( symbol: .default, - stringValue: "Test case passing \(arguments.count.counting("argument")) \(testCase.labeledArguments(includingQualifiedTypeNames: verbosity > 0)) to \(testName)\(status) started." + stringValue: "Test case passing \(arguments.count.counting("argument")) \(testCase.labeledArguments(includingQualifiedTypeNames: verbosity > 0)) to \(testName) started." ) ] diff --git a/Tests/TestingTests/EventRecorderTests.swift b/Tests/TestingTests/EventRecorderTests.swift index ed7d765a0..e3dc9ca99 100644 --- a/Tests/TestingTests/EventRecorderTests.swift +++ b/Tests/TestingTests/EventRecorderTests.swift @@ -113,6 +113,10 @@ struct EventRecorderTests { #expect(buffer.contains(#"\#(Event.Symbol.details.unicodeCharacter) lhs: Swift.String → "987""#)) #expect(buffer.contains(#""Animal Crackers" (aka 'WrittenTests')"#)) #expect(buffer.contains(#""Not A Lobster" (aka 'actuallyCrab()')"#)) + do { + let regex = try Regex(".* Test case passing 1 argument i → 0 \\(Swift.Int\\) to multitudeOcelot\\(i:\\) started.") + #expect(try buffer.split(whereSeparator: \.isNewline).compactMap(regex.wholeMatch(in:)).first != nil) + } do { let regex = try Regex(".* Test case passing 1 argument i → 0 \\(Swift.Int\\) to multitudeOcelot\\(i:\\) passed after .*.") #expect(try buffer.split(whereSeparator: \.isNewline).compactMap(regex.wholeMatch(in:)).first != nil)