diff --git a/Sources/Testing/Parameterization/Test.Case.Generator.swift b/Sources/Testing/Parameterization/Test.Case.Generator.swift index 4ed4534d5..a11e01ee7 100644 --- a/Sources/Testing/Parameterization/Test.Case.Generator.swift +++ b/Sources/Testing/Parameterization/Test.Case.Generator.swift @@ -235,7 +235,7 @@ extension Test.Case { arguments collection: S, parameters: [Test.Parameter], testFunction: @escaping @Sendable ((S.Key, S.Value)) async throws -> Void - ) where S: __DictionaryLikeCollection { + ) where S: ExpressibleByDictionaryLiteral, S.Element == (key: S.Key, value: S.Value) { if parameters.count > 1 { self.init(sequence: collection) { element in Test.Case(values: [element.key, element.value], parameters: parameters) { diff --git a/Sources/Testing/Test+Macro.swift b/Sources/Testing/Test+Macro.swift index d89b21bfc..a3da539c9 100644 --- a/Sources/Testing/Test+Macro.swift +++ b/Sources/Testing/Test+Macro.swift @@ -455,7 +455,7 @@ extension Test { sourceBounds: __SourceBounds, parameters paramTuples: [__Parameter], testFunction: @escaping @Sendable (C.Element) async throws -> Void - ) -> Self where S: ~Copyable & ~Escapable, C: __DictionaryLikeCollection & Sendable, C.Key: Sendable, C.Value: Sendable { + ) -> Self where S: ~Copyable & ~Escapable, C: ExpressibleByDictionaryLiteral & Collection & Sendable, C.Element == (key: C.Key, value: C.Value), C.Key: Sendable, C.Value: Sendable { let containingTypeInfo: TypeInfo? = if let containingType { TypeInfo(describing: containingType) } else { @@ -529,21 +529,6 @@ extension Test { warning message: _const String ) = #externalMacro(module: "TestingMacros", type: "PragmaMacro") -// MARK: - Dictionary-like collection disambiguation - -/// A protocol that describes the basic shape of a "dictionary-like" collection -/// whose elements are key-value pairs. -/// -/// - Warning: This protocol is used to implement the `@Test` macro. Do not use -/// it directly. -public protocol __DictionaryLikeCollection: Collection where Element == (key: Key, value: Value) { - associatedtype Key - associatedtype Value -} - -extension Dictionary: __DictionaryLikeCollection {} -extension KeyValuePairs: __DictionaryLikeCollection {} - // MARK: - Helper functions /// A function that abstracts away whether or not the `try` keyword is needed on