Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions Sources/Testing/Running/EntryPoint.swift
Original file line number Diff line number Diff line change
Expand Up @@ -107,12 +107,14 @@ func listTestsForSwiftPM(_ tests: some Sequence<Test>) -> [String] {
// Group tests by the name components of the tests' IDs. If the name
// components of two tests' IDs are ambiguous, present their source locations
// to disambiguate.
return Dictionary(
let initialGroups = Dictionary(
grouping: tests.lazy.map(\.id),
by: \.nameComponents
).values.lazy
.map { ($0, isAmbiguous: $0.count > 1) }
.flatMap { testIDs, isAmbiguous in

// This operation is split to improve type-checking performance.
return initialGroups.flatMap { testIDs, isAmbiguous in
testIDs.lazy
.map { testID in
if !isAmbiguous, testID.sourceLocation != nil {
Expand Down