mirror of
https://github.com/RevenueCat/purchases-ios
synced 2026-11-11 22:55:55 +05:45
* 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
31 lines
811 B
Swift
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
|
|
}
|
|
}
|
|
|
|
}
|