We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents 14c6668 + 632a80a commit f8c8d1eCopy full SHA for f8c8d1e
Sources/ContentEquatable.swift
@@ -50,3 +50,19 @@ extension Optional: ContentEquatable where Wrapped: ContentEquatable {
50
}
51
52
53
+
54
+extension Array: ContentEquatable where Element: ContentEquatable {
55
+ /// Indicate whether the content of `self` is equals to the content of
56
+ /// the given source value.
57
+ ///
58
+ /// - Parameters:
59
+ /// - source: A source value to be compared.
60
61
+ /// - Returns: A Boolean value indicating whether the content of `self` is equals
62
+ /// to the content of the given source value.
63
+ @inlinable
64
+ public func isContentEqual(to source: [Element]) -> Bool {
65
+ return count == source.count
66
+ && zip(self, source).allSatisfy { $0.isContentEqual(to: $1) }
67
+ }
68
+}
0 commit comments