File tree Expand file tree Collapse file tree 1 file changed +10
-8
lines changed
Sources/Testing/Events/Recorder Expand file tree Collapse file tree 1 file changed +10
-8
lines changed Original file line number Diff line number Diff line change @@ -187,15 +187,17 @@ extension Event {
187187 /// - Returns: The fully qualified name, with display name substituted if
188188 /// available.
189189 private func fullyQualifiedName( for failedTest: FailedTest ) -> String {
190- var name = failedTest. path. dropFirst ( ) . joined ( separator: " / " )
191-
192- // Use display name for the last component if available
193- if let displayName = failedTest. displayName, !failedTest. path. isEmpty {
194- let pathWithoutLast = failedTest. path. dropFirst ( ) . dropLast ( )
195- name = ( pathWithoutLast + [ #"" \#( displayName) ""# ] ) . joined ( separator: " / " )
190+ // Omit the leading path component representing the module name from the
191+ // fully-qualified name of the test.
192+ let path = failedTest. path. dropFirst ( )
193+
194+ // Use display name for the last component if available. Otherwise, join
195+ // the path components.
196+ return if let displayName = failedTest. displayName, !failedTest. path. isEmpty {
197+ ( path. dropLast ( ) + [ #"" \#( displayName) ""# ] ) . joined ( separator: " / " )
198+ } else {
199+ path. joined ( separator: " / " )
196200 }
197-
198- return name
199201 }
200202
201203 /// Format a single issue entry.
You can’t perform that action at this time.
0 commit comments