2020-03-22 02:36:11 +00:00
|
|
|
import Foundation
|
2025-01-05 08:22:11 +00:00
|
|
|
import Testing
|
2020-03-22 02:37:08 +00:00
|
|
|
@testable import SecretKit
|
2022-01-02 00:43:29 +00:00
|
|
|
@testable import SecureEnclaveSecretKit
|
|
|
|
@testable import SmartCardSecretKit
|
2020-03-22 02:37:08 +00:00
|
|
|
|
2025-01-05 08:22:11 +00:00
|
|
|
@Suite struct AnySecretTests {
|
2020-03-22 02:37:08 +00:00
|
|
|
|
2025-01-05 08:22:11 +00:00
|
|
|
@Test func eraser() {
|
2020-03-22 02:37:08 +00:00
|
|
|
let secret = SmartCard.Secret(id: UUID().uuidString.data(using: .utf8)!, name: "Name", algorithm: .ellipticCurve, keySize: 256, publicKey: UUID().uuidString.data(using: .utf8)!)
|
|
|
|
let erased = AnySecret(secret)
|
2025-01-05 08:22:11 +00:00
|
|
|
#expect(erased.id == secret.id as AnyHashable)
|
|
|
|
#expect(erased.name == secret.name)
|
|
|
|
#expect(erased.algorithm == secret.algorithm)
|
|
|
|
#expect(erased.keySize == secret.keySize)
|
|
|
|
#expect(erased.publicKey == secret.publicKey)
|
2020-03-22 02:37:08 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
}
|