Files
purchases-ios/Tests/UnitTests/TestHelpers/AnyEncodable+Equatable.swift
T
Antonio Pallares de879a0889 Use array instead of sets in diagnostics events (#4839)
* tests: remove `Equatable` conformance of `DiagnosticsEvent` and `AnyEncodable` from RevenueCat and added to test targets (where it's needed)

* Use Arrays instead of Sets in Diagnostics events to have predictable order in sent events

* tests: compare Sets vs Arrays in unit test

The conversion from Array --> Set --> Array may change the order of the elements

* remove `DiagnosticsEvent+Equatable` from some targets

* PR #4839 fixes

* remove `AnyEncodable+Equatable.swift` from some targets
2025-03-02 12:50:03 +01:00

31 lines
811 B
Swift

//
// Copyright RevenueCat Inc. All Rights Reserved.
//
// Licensed under the MIT License (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// https://opensource.org/licenses/MIT
//
// AnyEncodable+Equatable.swift
//
// Created by Antonio Pallares on 28/2/25.
import Foundation
@testable import RevenueCat
// Specifying the module names silences the warning in Xcode 16+
extension RevenueCat.AnyEncodable: Swift.Equatable {
public static func == (lhs: AnyEncodable, rhs: AnyEncodable) -> Bool {
do {
let lhsData = try lhs.prettyPrintedData
let rhsData = try rhs.prettyPrintedData
return lhsData == rhsData
} catch {
return false
}
}
}