Skip to content

Commit cc736a7

Browse files
[PubgrubTests] Replace OrderedDictionary with KeyValuePairs in DependencyGraphBuilder.serve
[One of the callers](https://github.com/apple/swift-package-manager/blob/20eba126ffa32088abb46d642bd0481dbae212ef/Tests/PackageGraphTests/PubgrubTests.swift#L472-L475) of the function passes in a dictionary literal with duplicate keys. `TSCBasic.OrderedDictionary` preserves [the final](https://github.com/apple/swift-tools-support-core/blob/21a79185b2ea8f89b9253ed8cdf2338bf564c499/Sources/TSCBasic/OrderedDictionary.swift#L97-L99) of all duplicate keys' values in a dictionary literal. The logic in this function suggests that duplicate keys can be allowed, and `KeyValuePairs` does exactly that.
1 parent 20eba12 commit cc736a7

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

Tests/PackageGraphTests/PubgrubTests.swift

+2-2
Original file line numberDiff line numberDiff line change
@@ -2166,7 +2166,7 @@ class DependencyGraphBuilder {
21662166
_ package: String,
21672167
at version: Version,
21682168
toolsVersion: ToolsVersion? = nil,
2169-
with dependencies: OrderedDictionary<String, OrderedDictionary<String, (PackageRequirement, ProductFilter)>> = [:]
2169+
with dependencies: KeyValuePairs<String, OrderedDictionary<String, (PackageRequirement, ProductFilter)>> = [:]
21702170
) {
21712171
serve(package, at: .version(version), toolsVersion: toolsVersion, with: dependencies)
21722172
}
@@ -2175,7 +2175,7 @@ class DependencyGraphBuilder {
21752175
_ package: String,
21762176
at version: BoundVersion,
21772177
toolsVersion: ToolsVersion? = nil,
2178-
with dependencies: OrderedDictionary<String, OrderedDictionary<String, (PackageRequirement, ProductFilter)>> = [:]
2178+
with dependencies: KeyValuePairs<String, OrderedDictionary<String, (PackageRequirement, ProductFilter)>> = [:]
21792179
) {
21802180
let packageReference = reference(for: package)
21812181
let container = self.containers[package] ?? MockContainer(package: packageReference)

0 commit comments

Comments
 (0)