Skip to content

Commit b742077

Browse files
committed
Remove redundant overload of expandedDescription()
1 parent 5bc8b84 commit b742077

File tree

2 files changed

+5
-21
lines changed

2 files changed

+5
-21
lines changed

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

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -427,11 +427,7 @@ extension Event.HumanReadableOutputRecorder {
427427
if verbosity >= 0, case let .expectationFailed(expectation) = issue.kind {
428428
let expression = expectation.evaluatedExpression
429429
func addMessage(about expression: __Expression, depth: Int) {
430-
let description = if verbosity <= 0 {
431-
expression.expandedDescription()
432-
} else {
433-
expression.expandedDebugDescription()
434-
}
430+
let description = expression.expandedDescription(verbose: verbosity > 0)
435431
if description != expression.sourceCode {
436432
additionalMessages.append(Message(symbol: .details, indentation: depth, stringValue: description))
437433
}

Sources/Testing/SourceAttribution/Expression.swift

Lines changed: 4 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -210,19 +210,7 @@ public struct __Expression: Sendable {
210210
/// - Returns: A string describing this instance.
211211
@_spi(ForToolsIntegrationOnly)
212212
public func expandedDescription() -> String {
213-
_expandedDescription(verbose: false)
214-
}
215-
216-
/// Get an expanded description of this instance that contains the source
217-
/// code and runtime value (or values) it represents.
218-
///
219-
/// - Returns: A string describing this instance.
220-
///
221-
/// This function produces a more detailed description than
222-
/// ``expandedDescription()``, similar to how `String(reflecting:)` produces
223-
/// a more detailed description than `String(describing:)`.
224-
func expandedDebugDescription() -> String {
225-
_expandedDescription(verbose: true)
213+
expandedDescription(verbose: false)
226214
}
227215

228216
/// Get an expanded description of this instance that contains the source
@@ -233,9 +221,9 @@ public struct __Expression: Sendable {
233221
///
234222
/// - Returns: A string describing this instance.
235223
///
236-
/// This function provides the implementation of ``expandedDescription()`` and
237-
/// ``expandedDebugDescription()``.
238-
private func _expandedDescription(verbose: Bool) -> String {
224+
/// This function provides the implementation of ``expandedDescription()``
225+
/// with additional options used by ``Event/HumanReadableOutputRecorder``.
226+
func expandedDescription(verbose: Bool) -> String {
239227
var result = sourceCode
240228

241229
if verbose, let qualifiedName = runtimeValue?.typeInfo.fullyQualifiedName {

0 commit comments

Comments
 (0)