diff --git a/Sources/Packages/Tests/BriefTests/ReleaseParsingTests.swift b/Sources/Packages/Tests/BriefTests/ReleaseParsingTests.swift index 74af9ee..044a056 100644 --- a/Sources/Packages/Tests/BriefTests/ReleaseParsingTests.swift +++ b/Sources/Packages/Tests/BriefTests/ReleaseParsingTests.swift @@ -1,54 +1,66 @@ -import XCTest +import Testing +import Foundation @testable import Brief -class ReleaseParsingTests: XCTestCase { - func testNonCritical() { +@Suite struct ReleaseParsingTests { + + @Test + func nonCritical() { let release = Release(name: "1.0.0", prerelease: false, html_url: URL(string: "https://example.com")!, body: "Initial release") - XCTAssert(release.critical == false) + #expect(release.critical == false) } - func testCritical() { + @Test + func critical() { let release = Release(name: "1.0.0", prerelease: false, html_url: URL(string: "https://example.com")!, body: "Critical Security Update") - XCTAssert(release.critical == true) + #expect(release.critical == true) } - func testOSMissing() { + @Test + func osMissing() { let release = Release(name: "1.0.0", prerelease: false, html_url: URL(string: "https://example.com")!, body: "Critical Security Update") - XCTAssert(release.minimumOSVersion == SemVer("11.0.0")) + #expect(release.minimumOSVersion == SemVer("11.0.0")) } - func testOSPresentWithContentBelow() { + @Test + func osPresentWithContentBelow() { let release = Release(name: "1.0.0", prerelease: false, html_url: URL(string: "https://example.com")!, body: "Critical Security Update ##Minimum macOS Version\n1.2.3\nBuild info") - XCTAssert(release.minimumOSVersion == SemVer("1.2.3")) + #expect(release.minimumOSVersion == SemVer("1.2.3")) } - func testOSPresentAtEnd() { + @Test + func osPresentAtEnd() { let release = Release(name: "1.0.0", prerelease: false, html_url: URL(string: "https://example.com")!, body: "Critical Security Update Minimum macOS Version: 1.2.3") - XCTAssert(release.minimumOSVersion == SemVer("1.2.3")) + #expect(release.minimumOSVersion == SemVer("1.2.3")) } - func testOSWithMacOSPrefix() { + @Test + func osWithMacOSPrefix() { let release = Release(name: "1.0.0", prerelease: false, html_url: URL(string: "https://example.com")!, body: "Critical Security Update Minimum macOS Version: macOS 1.2.3") - XCTAssert(release.minimumOSVersion == SemVer("1.2.3")) + #expect(release.minimumOSVersion == SemVer("1.2.3")) } - func testOSGreaterThanMinimum() { + @Test + func osGreaterThanMinimum() { let release = Release(name: "1.0.0", prerelease: false, html_url: URL(string: "https://example.com")!, body: "Critical Security Update Minimum macOS Version: 1.2.3") - XCTAssert(release.minimumOSVersion < SemVer("11.0.0")) + #expect(release.minimumOSVersion < SemVer("11.0.0")) } - func testOSEqualToMinimum() { + @Test + func osEqualToMinimum() { let release = Release(name: "1.0.0", prerelease: false, html_url: URL(string: "https://example.com")!, body: "Critical Security Update Minimum macOS Version: 11.2.3") - XCTAssert(release.minimumOSVersion <= SemVer("11.2.3")) + #expect(release.minimumOSVersion <= SemVer("11.2.3")) } - func testOSLessThanMinimum() { + @Test + func osLessThanMinimum() { let release = Release(name: "1.0.0", prerelease: false, html_url: URL(string: "https://example.com")!, body: "Critical Security Update Minimum macOS Version: 1.2.3") - XCTAssert(release.minimumOSVersion > SemVer("1.0.0")) + #expect(release.minimumOSVersion > SemVer("1.0.0")) } - func testGreatestSelectedIfOldPatchIsPublishedLater() { + @Test + func greatestSelectedIfOldPatchIsPublishedLater() async throws { // If 2.x.x series has been published, and a patch for 1.x.x is issued // 2.x.x should still be selected if user can run it. let updater = Updater(checkOnLaunch: false, osVersion: SemVer("2.2.3"), currentVersion: SemVer("1.0.0")) @@ -60,16 +72,13 @@ class ReleaseParsingTests: XCTestCase { Release(name: "1.0.2", prerelease: false, html_url: URL(string: "https://example.com")!, body: "Emergency patch! Minimum macOS Version: 1.2.3"), ] - let expectation = XCTestExpectation() updater.evaluate(releases: releases) - DispatchQueue.main.async { - XCTAssert(updater.update == two) - expectation.fulfill() - } - wait(for: [expectation], timeout: 1) + try await Task.sleep(nanoseconds: 500) + #expect(updater.update == two) } - func testLatestVersionIsRunnable() { + @Test + func latestVersionIsRunnable() async throws { // If the 2.x.x series has been published but the user can't run it // the last version the user can run should be selected. let updater = Updater(checkOnLaunch: false, osVersion: SemVer("1.2.3"), currentVersion: SemVer("1.0.0")) @@ -80,16 +89,13 @@ class ReleaseParsingTests: XCTestCase { Release(name: "2.0.0", prerelease: false, html_url: URL(string: "https://example.com")!, body: "2.0 available! Minimum macOS Version: 2.2.3"), Release(name: "1.0.2", prerelease: false, html_url: URL(string: "https://example.com")!, body: "Emergency patch! Minimum macOS Version: 1.2.3"), ] - let expectation = XCTestExpectation() updater.evaluate(releases: releases) - DispatchQueue.main.async { - XCTAssert(updater.update == oneOhTwo) - expectation.fulfill() - } - wait(for: [expectation], timeout: 1) + try await Task.sleep(nanoseconds: 500) + #expect(updater.update == oneOhTwo) } - func testSorting() { + @Test + func sorting() { let two = Release(name: "2.0.0", prerelease: false, html_url: URL(string: "https://example.com")!, body: "2.0 available!") let releases = [ Release(name: "1.0.0", prerelease: false, html_url: URL(string: "https://example.com")!, body: "Initial release"), @@ -98,7 +104,7 @@ class ReleaseParsingTests: XCTestCase { Release(name: "1.0.2", prerelease: false, html_url: URL(string: "https://example.com")!, body: "Emergency patch!"), ] let sorted = releases.sorted().reversed().first - XCTAssert(sorted == two) + #expect(sorted == two) } } diff --git a/Sources/Packages/Tests/BriefTests/SemVerTests.swift b/Sources/Packages/Tests/BriefTests/SemVerTests.swift index f7ee332..5cd5738 100644 --- a/Sources/Packages/Tests/BriefTests/SemVerTests.swift +++ b/Sources/Packages/Tests/BriefTests/SemVerTests.swift @@ -1,51 +1,52 @@ -import XCTest +import Testing +import Foundation @testable import Brief -class SemVerTests: XCTestCase { +@Suite struct SemVerTests { - func testEqual() { + @Test func equal() { let current = SemVer("1.0.2") let old = SemVer("1.0.2") - XCTAssert(!(current > old)) + #expect(!(current > old)) } - func testPatchGreaterButMinorLess() { + @Test func patchGreaterButMinorLess() { let current = SemVer("1.1.0") let old = SemVer("1.0.2") - XCTAssert(current > old) + #expect(current > old) } - func testMajorSameMinorGreater() { + @Test func majorSameMinorGreater() { let current = SemVer("1.0.2") let new = SemVer("1.0.3") - XCTAssert(current < new) + #expect(current < new) } - func testMajorGreaterMinorLesser() { + @Test func majorGreaterMinorLesser() { let current = SemVer("1.0.2") let new = SemVer("2.0.0") - XCTAssert(current < new) + #expect(current < new) } - func testRegularParsing() { + @Test func regularParsing() { let current = SemVer("1.0.2") - XCTAssert(current.versionNumbers == [1, 0, 2]) + #expect(current.versionNumbers == [1, 0, 2]) } - func testNoPatch() { + @Test func noPatch() { let current = SemVer("1.1") - XCTAssert(current.versionNumbers == [1, 1, 0]) + #expect(current.versionNumbers == [1, 1, 0]) } - func testGarbage() { + @Test func garbage() { let current = SemVer("Test") - XCTAssert(current.versionNumbers == [0, 0, 0]) + #expect(current.versionNumbers == [0, 0, 0]) } - func testBeta() { + @Test func beta() { let current = SemVer("1.0.2") let new = SemVer("1.1.0_beta1") - XCTAssert(current < new) + #expect(current < new) } } diff --git a/Sources/Packages/Tests/SecretAgentKitTests/AgentTests.swift b/Sources/Packages/Tests/SecretAgentKitTests/AgentTests.swift index 8753456..c99ae98 100644 --- a/Sources/Packages/Tests/SecretAgentKitTests/AgentTests.swift +++ b/Sources/Packages/Tests/SecretAgentKitTests/AgentTests.swift @@ -1,41 +1,41 @@ import Foundation -import XCTest +import Testing import CryptoKit @testable import SecretKit @testable import SecretAgentKit -class AgentTests: XCTestCase { +@Suite struct AgentTests { let stubWriter = StubFileHandleWriter() // MARK: Identity Listing - func testEmptyStores() async { + @Test func emptyStores() async { let stubReader = StubFileHandleReader(availableData: Constants.Requests.requestIdentities) let agent = Agent(storeList: SecretStoreList()) await agent.handle(reader: stubReader, writer: stubWriter) - XCTAssertEqual(stubWriter.data, Constants.Responses.requestIdentitiesEmpty) + #expect(stubWriter.data == Constants.Responses.requestIdentitiesEmpty) } - func testIdentitiesList() async { + @Test func identitiesList() async { let stubReader = StubFileHandleReader(availableData: Constants.Requests.requestIdentities) let list = storeList(with: [Constants.Secrets.ecdsa256Secret, Constants.Secrets.ecdsa384Secret]) let agent = Agent(storeList: list) await agent.handle(reader: stubReader, writer: stubWriter) - XCTAssertEqual(stubWriter.data, Constants.Responses.requestIdentitiesMultiple) + #expect(stubWriter.data == Constants.Responses.requestIdentitiesMultiple) } // MARK: Signatures - func testNoMatchingIdentities() async { + @Test func noMatchingIdentities() async { let stubReader = StubFileHandleReader(availableData: Constants.Requests.requestSignatureWithNoneMatching) let list = storeList(with: [Constants.Secrets.ecdsa256Secret, Constants.Secrets.ecdsa384Secret]) let agent = Agent(storeList: list) await agent.handle(reader: stubReader, writer: stubWriter) -// XCTAssertEqual(stubWriter.data, Constants.Responses.requestFailure) + #expect(stubWriter.data == Constants.Responses.requestFailure) } - func testSignature() async throws { + @Test func signature() async throws { let stubReader = StubFileHandleReader(availableData: Constants.Requests.requestSignature) let requestReader = OpenSSHReader(data: Constants.Requests.requestSignature[5...]) _ = requestReader.readNextChunk() @@ -67,16 +67,16 @@ class AgentTests: XCTestCase { let invalidRandomSignature = try await store.verify(signature: "invalid".data(using: .utf8)!, for: dataToSign, with: AnySecret(Constants.Secrets.ecdsa256Secret)) let invalidRandomData = try await store.verify(signature: signature.derRepresentation, for: "invalid".data(using: .utf8)!, with: AnySecret(Constants.Secrets.ecdsa256Secret)) let invalidWrongKey = try await store.verify(signature: signature.derRepresentation, for: dataToSign, with: AnySecret(Constants.Secrets.ecdsa384Secret)) - XCTAssertTrue(referenceValid) - XCTAssertTrue(derVerifies) - XCTAssert(invalidRandomSignature == false) - XCTAssert(invalidRandomData == false) - XCTAssert(invalidWrongKey == false) + #expect(referenceValid) + #expect(derVerifies) + #expect(invalidRandomSignature == false) + #expect(invalidRandomData == false) + #expect(invalidWrongKey == false) } // MARK: Witness protocol - func testWitnessObjectionStopsRequest() async { + @Test func witnessObjectionStopsRequest() async { let stubReader = StubFileHandleReader(availableData: Constants.Requests.requestSignature) let list = storeList(with: [Constants.Secrets.ecdsa256Secret]) let witness = StubWitness(speakNow: { _,_ in @@ -84,10 +84,10 @@ class AgentTests: XCTestCase { }, witness: { _, _ in }) let agent = Agent(storeList: list, witness: witness) await agent.handle(reader: stubReader, writer: stubWriter) - XCTAssertEqual(stubWriter.data, Constants.Responses.requestFailure) + #expect(stubWriter.data == Constants.Responses.requestFailure) } - func testWitnessSignature() async { + @Test func witnessSignature() async { let stubReader = StubFileHandleReader(availableData: Constants.Requests.requestSignature) let list = storeList(with: [Constants.Secrets.ecdsa256Secret]) var witnessed = false @@ -98,10 +98,10 @@ class AgentTests: XCTestCase { }) let agent = Agent(storeList: list, witness: witness) await agent.handle(reader: stubReader, writer: stubWriter) - XCTAssertTrue(witnessed) + #expect(witnessed) } - func testRequestTracing() async { + @Test func requestTracing() async { let stubReader = StubFileHandleReader(availableData: Constants.Requests.requestSignature) let list = storeList(with: [Constants.Secrets.ecdsa256Secret]) var speakNowTrace: SigningRequestProvenance! = nil @@ -114,31 +114,31 @@ class AgentTests: XCTestCase { }) let agent = Agent(storeList: list, witness: witness) await agent.handle(reader: stubReader, writer: stubWriter) - XCTAssertEqual(witnessTrace, speakNowTrace) - XCTAssertEqual(witnessTrace.origin.displayName, "Finder") - XCTAssertEqual(witnessTrace.origin.validSignature, true) - XCTAssertEqual(witnessTrace.origin.parentPID, 1) + #expect(witnessTrace == speakNowTrace) + #expect(witnessTrace.origin.displayName == "Finder") + #expect(witnessTrace.origin.validSignature == true) + #expect(witnessTrace.origin.parentPID == 1) } // MARK: Exception Handling - func testSignatureException() async { + @Test func signatureException() async { let stubReader = StubFileHandleReader(availableData: Constants.Requests.requestSignature) let list = storeList(with: [Constants.Secrets.ecdsa256Secret, Constants.Secrets.ecdsa384Secret]) let store = list.stores.first?.base as! Stub.Store store.shouldThrow = true let agent = Agent(storeList: list) await agent.handle(reader: stubReader, writer: stubWriter) - XCTAssertEqual(stubWriter.data, Constants.Responses.requestFailure) + #expect(stubWriter.data == Constants.Responses.requestFailure) } // MARK: Unsupported - func testUnhandledAdd() async { + @Test func unhandledAdd() async { let stubReader = StubFileHandleReader(availableData: Constants.Requests.addIdentity) let agent = Agent(storeList: SecretStoreList()) await agent.handle(reader: stubReader, writer: stubWriter) - XCTAssertEqual(stubWriter.data, Constants.Responses.requestFailure) + #expect(stubWriter.data == Constants.Responses.requestFailure) } } diff --git a/Sources/Packages/Tests/SecretKitTests/AnySecretTests.swift b/Sources/Packages/Tests/SecretKitTests/AnySecretTests.swift index ee2646b..f8229bd 100644 --- a/Sources/Packages/Tests/SecretKitTests/AnySecretTests.swift +++ b/Sources/Packages/Tests/SecretKitTests/AnySecretTests.swift @@ -1,19 +1,19 @@ import Foundation -import XCTest +import Testing @testable import SecretKit @testable import SecureEnclaveSecretKit @testable import SmartCardSecretKit -class AnySecretTests: XCTestCase { +@Suite struct AnySecretTests { - func testEraser() { + @Test func eraser() { 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) - XCTAssert(erased.id == secret.id as AnyHashable) - XCTAssert(erased.name == secret.name) - XCTAssert(erased.algorithm == secret.algorithm) - XCTAssert(erased.keySize == secret.keySize) - XCTAssert(erased.publicKey == secret.publicKey) + #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) } } diff --git a/Sources/Packages/Tests/SecretKitTests/OpenSSHReaderTests.swift b/Sources/Packages/Tests/SecretKitTests/OpenSSHReaderTests.swift index 5ad7494..39c3029 100644 --- a/Sources/Packages/Tests/SecretKitTests/OpenSSHReaderTests.swift +++ b/Sources/Packages/Tests/SecretKitTests/OpenSSHReaderTests.swift @@ -1,19 +1,19 @@ import Foundation -import XCTest +import Testing @testable import SecretKit @testable import SecureEnclaveSecretKit @testable import SmartCardSecretKit -class OpenSSHReaderTests: XCTestCase { +@Suite struct OpenSSHReaderTests { - func testSignatureRequest() { + @Test func signatureRequest() { let reader = OpenSSHReader(data: Constants.signatureRequest) let hash = reader.readNextChunk() - XCTAssert(hash == Data(base64Encoded: "AAAAE2VjZHNhLXNoYTItbmlzdHAzODQAAAAIbmlzdHAzODQAAABhBEqCbkJbOHy5S1wVCaJoKPmpS0egM4frMqllgnlRRQ/Uvnn6EVS8oV03cPA2Bz0EdESyRKA/sbmn0aBtgjIwGELxu45UXEW1TEz6TxyS0u3vuIqR3Wo1CrQWRDnkrG/pBQ==")) + #expect(hash == Data(base64Encoded: "AAAAE2VjZHNhLXNoYTItbmlzdHAzODQAAAAIbmlzdHAzODQAAABhBEqCbkJbOHy5S1wVCaJoKPmpS0egM4frMqllgnlRRQ/Uvnn6EVS8oV03cPA2Bz0EdESyRKA/sbmn0aBtgjIwGELxu45UXEW1TEz6TxyS0u3vuIqR3Wo1CrQWRDnkrG/pBQ==")) let dataToSign = reader.readNextChunk() - XCTAssert(dataToSign == Data(base64Encoded: "AAAAICi5xf1ixOestUlxdjvt/BDcM+rzhwy7Vo8cW5YcxA8+MgAAAANnaXQAAAAOc3NoLWNvbm5lY3Rpb24AAAAJcHVibGlja2V5AQAAABNlY2RzYS1zaGEyLW5pc3RwMzg0AAAAiAAAABNlY2RzYS1zaGEyLW5pc3RwMzg0AAAACG5pc3RwMzg0AAAAYQRKgm5CWzh8uUtcFQmiaCj5qUtHoDOH6zKpZYJ5UUUP1L55+hFUvKFdN3DwNgc9BHREskSgP7G5p9GgbYIyMBhC8buOVFxFtUxM+k8cktLt77iKkd1qNQq0FkQ55Kxv6QU=")) + #expect(dataToSign == Data(base64Encoded: "AAAAICi5xf1ixOestUlxdjvt/BDcM+rzhwy7Vo8cW5YcxA8+MgAAAANnaXQAAAAOc3NoLWNvbm5lY3Rpb24AAAAJcHVibGlja2V5AQAAABNlY2RzYS1zaGEyLW5pc3RwMzg0AAAAiAAAABNlY2RzYS1zaGEyLW5pc3RwMzg0AAAACG5pc3RwMzg0AAAAYQRKgm5CWzh8uUtcFQmiaCj5qUtHoDOH6zKpZYJ5UUUP1L55+hFUvKFdN3DwNgc9BHREskSgP7G5p9GgbYIyMBhC8buOVFxFtUxM+k8cktLt77iKkd1qNQq0FkQ55Kxv6QU=")) let empty = reader.readNextChunk() - XCTAssert(empty.isEmpty) + #expect(empty.isEmpty) } } diff --git a/Sources/Packages/Tests/SecretKitTests/OpenSSHWriterTests.swift b/Sources/Packages/Tests/SecretKitTests/OpenSSHWriterTests.swift index 6e9718f..e471992 100644 --- a/Sources/Packages/Tests/SecretKitTests/OpenSSHWriterTests.swift +++ b/Sources/Packages/Tests/SecretKitTests/OpenSSHWriterTests.swift @@ -1,45 +1,45 @@ import Foundation -import XCTest +import Testing @testable import SecretKit @testable import SecureEnclaveSecretKit @testable import SmartCardSecretKit -class OpenSSHWriterTests: XCTestCase { +@Suite struct OpenSSHWriterTests { let writer = OpenSSHKeyWriter() - func testECDSA256MD5Fingerprint() { - XCTAssertEqual(writer.openSSHMD5Fingerprint(secret: Constants.ecdsa256Secret), "dc:60:4d:ff:c2:d9:18:8b:2f:24:40:b5:7f:43:47:e5") + @Test func ecdsa256MD5Fingerprint() { + #expect(writer.openSSHMD5Fingerprint(secret: Constants.ecdsa256Secret) == "dc:60:4d:ff:c2:d9:18:8b:2f:24:40:b5:7f:43:47:e5") } - func testECDSA256SHA256Fingerprint() { - XCTAssertEqual(writer.openSSHSHA256Fingerprint(secret: Constants.ecdsa256Secret), "SHA256:/VQFeGyM8qKA8rB6WGMuZZxZLJln2UgXLk3F0uTF650") + @Test func ecdsa256SHA256Fingerprint() { + #expect(writer.openSSHSHA256Fingerprint(secret: Constants.ecdsa256Secret) == "SHA256:/VQFeGyM8qKA8rB6WGMuZZxZLJln2UgXLk3F0uTF650") } - func testECDSA256PublicKey() { - XCTAssertEqual(writer.openSSHString(secret: Constants.ecdsa256Secret), + @Test func ecdsa256PublicKey() { + #expect(writer.openSSHString(secret: Constants.ecdsa256Secret) == "ecdsa-sha2-nistp256 AAAAE2VjZHNhLXNoYTItbmlzdHAyNTYAAAAIbmlzdHAyNTYAAABBBOVEjgAA5PHqRgwykjN5qM21uWCHFSY/Sqo5gkHAkn+e1MMQKHOLga7ucB9b3mif33MBid59GRK9GEPVlMiSQwo=") } - func testECDSA256Hash() { - XCTAssertEqual(writer.data(secret: Constants.ecdsa256Secret), Data(base64Encoded: "AAAAE2VjZHNhLXNoYTItbmlzdHAyNTYAAAAIbmlzdHAyNTYAAABBBOVEjgAA5PHqRgwykjN5qM21uWCHFSY/Sqo5gkHAkn+e1MMQKHOLga7ucB9b3mif33MBid59GRK9GEPVlMiSQwo=")) + @Test func ecdsa256Hash() { + #expect(writer.data(secret: Constants.ecdsa256Secret) == Data(base64Encoded: "AAAAE2VjZHNhLXNoYTItbmlzdHAyNTYAAAAIbmlzdHAyNTYAAABBBOVEjgAA5PHqRgwykjN5qM21uWCHFSY/Sqo5gkHAkn+e1MMQKHOLga7ucB9b3mif33MBid59GRK9GEPVlMiSQwo=")) } - func testECDSA384MD5Fingerprint() { - XCTAssertEqual(writer.openSSHMD5Fingerprint(secret: Constants.ecdsa384Secret), "66:e0:66:d7:41:ed:19:8e:e2:20:df:ce:ac:7e:2b:6e") + @Test func ecdsa384MD5Fingerprint() { + #expect(writer.openSSHMD5Fingerprint(secret: Constants.ecdsa384Secret) == "66:e0:66:d7:41:ed:19:8e:e2:20:df:ce:ac:7e:2b:6e") } - func testECDSA384SHA256Fingerprint() { - XCTAssertEqual(writer.openSSHSHA256Fingerprint(secret: Constants.ecdsa384Secret), "SHA256:GJUEymQNL9ymaMRRJCMGY4rWIJHu/Lm8Yhao/PAiz1I") + @Test func ecdsa384SHA256Fingerprint() { + #expect(writer.openSSHSHA256Fingerprint(secret: Constants.ecdsa384Secret) == "SHA256:GJUEymQNL9ymaMRRJCMGY4rWIJHu/Lm8Yhao/PAiz1I") } - func testECDSA384PublicKey() { - XCTAssertEqual(writer.openSSHString(secret: Constants.ecdsa384Secret), + @Test func ecdsa384PublicKey() { + #expect(writer.openSSHString(secret: Constants.ecdsa384Secret) == "ecdsa-sha2-nistp384 AAAAE2VjZHNhLXNoYTItbmlzdHAzODQAAAAIbmlzdHAzODQAAABhBG2MNc/C5OTHFE2tBvbZCVcpOGa8vBMquiTLkH4lwkeqOPxhi+PyYUfQZMTRJNPiTyWPoMBqNiCIFRVv60yPN/AHufHaOgbdTP42EgMlMMImkAjYUEv9DESHTVIs2PW1yQ==") } - func testECDSA384Hash() { - XCTAssertEqual(writer.data(secret: Constants.ecdsa384Secret), Data(base64Encoded: "AAAAE2VjZHNhLXNoYTItbmlzdHAzODQAAAAIbmlzdHAzODQAAABhBG2MNc/C5OTHFE2tBvbZCVcpOGa8vBMquiTLkH4lwkeqOPxhi+PyYUfQZMTRJNPiTyWPoMBqNiCIFRVv60yPN/AHufHaOgbdTP42EgMlMMImkAjYUEv9DESHTVIs2PW1yQ==")) + @Test func ecdsa384Hash() { + #expect(writer.data(secret: Constants.ecdsa384Secret) == Data(base64Encoded: "AAAAE2VjZHNhLXNoYTItbmlzdHAzODQAAAAIbmlzdHAzODQAAABhBG2MNc/C5OTHFE2tBvbZCVcpOGa8vBMquiTLkH4lwkeqOPxhi+PyYUfQZMTRJNPiTyWPoMBqNiCIFRVv60yPN/AHufHaOgbdTP42EgMlMMImkAjYUEv9DESHTVIs2PW1yQ==")) } } diff --git a/Sources/Secretive.xcodeproj/project.pbxproj b/Sources/Secretive.xcodeproj/project.pbxproj index 61fd17b..de462b1 100644 --- a/Sources/Secretive.xcodeproj/project.pbxproj +++ b/Sources/Secretive.xcodeproj/project.pbxproj @@ -30,7 +30,6 @@ 50617D8523FCE48E0099B055 /* ContentView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 50617D8423FCE48E0099B055 /* ContentView.swift */; }; 50617D8723FCE48E0099B055 /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 50617D8623FCE48E0099B055 /* Assets.xcassets */; }; 50617D8A23FCE48E0099B055 /* Preview Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 50617D8923FCE48E0099B055 /* Preview Assets.xcassets */; }; - 50617D9923FCE48E0099B055 /* SecretiveTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 50617D9823FCE48E0099B055 /* SecretiveTests.swift */; }; 50617DD223FCEFA90099B055 /* PreviewStore.swift in Sources */ = {isa = PBXBuildFile; fileRef = 50617DD123FCEFA90099B055 /* PreviewStore.swift */; }; 5065E313295517C500E16645 /* ToolbarButtonStyle.swift in Sources */ = {isa = PBXBuildFile; fileRef = 5065E312295517C500E16645 /* ToolbarButtonStyle.swift */; }; 5066A6C22516F303004B5A36 /* SetupView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 5066A6C12516F303004B5A36 /* SetupView.swift */; }; @@ -63,13 +62,6 @@ remoteGlobalIDString = 50A3B78924026B7500D209EA; remoteInfo = SecretAgent; }; - 50617D9523FCE48E0099B055 /* PBXContainerItemProxy */ = { - isa = PBXContainerItemProxy; - containerPortal = 50617D7723FCE48D0099B055 /* Project object */; - proxyType = 1; - remoteGlobalIDString = 50617D7E23FCE48D0099B055; - remoteInfo = Secretive; - }; /* End PBXContainerItemProxy section */ /* Begin PBXCopyFilesBuildPhase section */ @@ -123,9 +115,6 @@ 50617D8923FCE48E0099B055 /* Preview Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = "Preview Assets.xcassets"; sourceTree = ""; }; 50617D8E23FCE48E0099B055 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; 50617D8F23FCE48E0099B055 /* Secretive.entitlements */ = {isa = PBXFileReference; lastKnownFileType = text.plist.entitlements; path = Secretive.entitlements; sourceTree = ""; }; - 50617D9423FCE48E0099B055 /* SecretiveTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = SecretiveTests.xctest; sourceTree = BUILT_PRODUCTS_DIR; }; - 50617D9823FCE48E0099B055 /* SecretiveTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SecretiveTests.swift; sourceTree = ""; }; - 50617D9A23FCE48E0099B055 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; 50617DD123FCEFA90099B055 /* PreviewStore.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = PreviewStore.swift; sourceTree = ""; }; 5065E312295517C500E16645 /* ToolbarButtonStyle.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ToolbarButtonStyle.swift; sourceTree = ""; }; 5066A6C12516F303004B5A36 /* SetupView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SetupView.swift; sourceTree = ""; }; @@ -166,13 +155,6 @@ ); runOnlyForDeploymentPostprocessing = 0; }; - 50617D9123FCE48E0099B055 /* Frameworks */ = { - isa = PBXFrameworksBuildPhase; - buildActionMask = 2147483647; - files = ( - ); - runOnlyForDeploymentPostprocessing = 0; - }; 50A3B78724026B7500D209EA /* Frameworks */ = { isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; @@ -201,7 +183,6 @@ children = ( 5003EF39278005C800DF2006 /* Packages */, 50617D8123FCE48E0099B055 /* Secretive */, - 50617D9723FCE48E0099B055 /* SecretiveTests */, 50A3B78B24026B7500D209EA /* SecretAgent */, 508A58AF241E144C0069DC07 /* Config */, 50617D8023FCE48E0099B055 /* Products */, @@ -213,7 +194,6 @@ isa = PBXGroup; children = ( 50617D7F23FCE48E0099B055 /* Secretive.app */, - 50617D9423FCE48E0099B055 /* SecretiveTests.xctest */, 50A3B78A24026B7500D209EA /* SecretAgent.app */, ); name = Products; @@ -248,15 +228,6 @@ path = "Preview Content"; sourceTree = ""; }; - 50617D9723FCE48E0099B055 /* SecretiveTests */ = { - isa = PBXGroup; - children = ( - 50617D9823FCE48E0099B055 /* SecretiveTests.swift */, - 50617D9A23FCE48E0099B055 /* Info.plist */, - ); - path = SecretiveTests; - sourceTree = ""; - }; 508A58AF241E144C0069DC07 /* Config */ = { isa = PBXGroup; children = ( @@ -357,24 +328,6 @@ productReference = 50617D7F23FCE48E0099B055 /* Secretive.app */; productType = "com.apple.product-type.application"; }; - 50617D9323FCE48E0099B055 /* SecretiveTests */ = { - isa = PBXNativeTarget; - buildConfigurationList = 50617DA023FCE48E0099B055 /* Build configuration list for PBXNativeTarget "SecretiveTests" */; - buildPhases = ( - 50617D9023FCE48E0099B055 /* Sources */, - 50617D9123FCE48E0099B055 /* Frameworks */, - 50617D9223FCE48E0099B055 /* Resources */, - ); - buildRules = ( - ); - dependencies = ( - 50617D9623FCE48E0099B055 /* PBXTargetDependency */, - ); - name = SecretiveTests; - productName = SecretiveTests; - productReference = 50617D9423FCE48E0099B055 /* SecretiveTests.xctest */; - productType = "com.apple.product-type.bundle.unit-test"; - }; 50A3B78924026B7500D209EA /* SecretAgent */ = { isa = PBXNativeTarget; buildConfigurationList = 50A3B79A24026B7600D209EA /* Build configuration list for PBXNativeTarget "SecretAgent" */; @@ -413,10 +366,6 @@ 50617D7E23FCE48D0099B055 = { CreatedOnToolsVersion = 11.3; }; - 50617D9323FCE48E0099B055 = { - CreatedOnToolsVersion = 11.3; - TestTargetID = 50617D7E23FCE48D0099B055; - }; 50A3B78924026B7500D209EA = { CreatedOnToolsVersion = 11.4; }; @@ -443,7 +392,6 @@ projectRoot = ""; targets = ( 50617D7E23FCE48D0099B055 /* Secretive */, - 50617D9323FCE48E0099B055 /* SecretiveTests */, 50A3B78924026B7500D209EA /* SecretAgent */, ); }; @@ -462,13 +410,6 @@ ); runOnlyForDeploymentPostprocessing = 0; }; - 50617D9223FCE48E0099B055 /* Resources */ = { - isa = PBXResourcesBuildPhase; - buildActionMask = 2147483647; - files = ( - ); - runOnlyForDeploymentPostprocessing = 0; - }; 50A3B78824026B7500D209EA /* Resources */ = { isa = PBXResourcesBuildPhase; buildActionMask = 2147483647; @@ -514,14 +455,6 @@ ); runOnlyForDeploymentPostprocessing = 0; }; - 50617D9023FCE48E0099B055 /* Sources */ = { - isa = PBXSourcesBuildPhase; - buildActionMask = 2147483647; - files = ( - 50617D9923FCE48E0099B055 /* SecretiveTests.swift in Sources */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; 50A3B78624026B7500D209EA /* Sources */ = { isa = PBXSourcesBuildPhase; buildActionMask = 2147483647; @@ -539,11 +472,6 @@ target = 50A3B78924026B7500D209EA /* SecretAgent */; targetProxy = 50142166278126B500BBAA70 /* PBXContainerItemProxy */; }; - 50617D9623FCE48E0099B055 /* PBXTargetDependency */ = { - isa = PBXTargetDependency; - target = 50617D7E23FCE48D0099B055 /* Secretive */; - targetProxy = 50617D9523FCE48E0099B055 /* PBXContainerItemProxy */; - }; /* End PBXTargetDependency section */ /* Begin PBXVariantGroup section */ @@ -737,46 +665,6 @@ }; name = Release; }; - 50617DA123FCE48E0099B055 /* Debug */ = { - isa = XCBuildConfiguration; - buildSettings = { - ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES; - BUNDLE_LOADER = "$(TEST_HOST)"; - CODE_SIGN_STYLE = Automatic; - COMBINE_HIDPI_IMAGES = YES; - DEVELOPMENT_TEAM = Z72PRUAWF6; - INFOPLIST_FILE = SecretiveTests/Info.plist; - LD_RUNPATH_SEARCH_PATHS = ( - "$(inherited)", - "@executable_path/../Frameworks", - "@loader_path/../Frameworks", - ); - PRODUCT_BUNDLE_IDENTIFIER = com.maxgoedjen.SecretiveTests; - PRODUCT_NAME = "$(TARGET_NAME)"; - TEST_HOST = "$(BUILT_PRODUCTS_DIR)/Secretive.app/Contents/MacOS/Secretive"; - }; - name = Debug; - }; - 50617DA223FCE48E0099B055 /* Release */ = { - isa = XCBuildConfiguration; - buildSettings = { - ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES; - BUNDLE_LOADER = "$(TEST_HOST)"; - CODE_SIGN_STYLE = Automatic; - COMBINE_HIDPI_IMAGES = YES; - DEVELOPMENT_TEAM = Z72PRUAWF6; - INFOPLIST_FILE = SecretiveTests/Info.plist; - LD_RUNPATH_SEARCH_PATHS = ( - "$(inherited)", - "@executable_path/../Frameworks", - "@loader_path/../Frameworks", - ); - PRODUCT_BUNDLE_IDENTIFIER = com.maxgoedjen.SecretiveTests; - PRODUCT_NAME = "$(TARGET_NAME)"; - TEST_HOST = "$(BUILT_PRODUCTS_DIR)/Secretive.app/Contents/MacOS/Secretive"; - }; - name = Release; - }; 508A5914241EF1A00069DC07 /* Test */ = { isa = XCBuildConfiguration; baseConfigurationReference = 508A58AB241E121B0069DC07 /* Config.xcconfig */; @@ -866,27 +754,6 @@ }; name = Test; }; - 508A5916241EF1A00069DC07 /* Test */ = { - isa = XCBuildConfiguration; - buildSettings = { - ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES; - BUNDLE_LOADER = "$(TEST_HOST)"; - CODE_SIGN_IDENTITY = "-"; - CODE_SIGN_STYLE = Manual; - COMBINE_HIDPI_IMAGES = YES; - INFOPLIST_FILE = SecretiveTests/Info.plist; - LD_RUNPATH_SEARCH_PATHS = ( - "$(inherited)", - "@executable_path/../Frameworks", - "@loader_path/../Frameworks", - ); - PRODUCT_BUNDLE_IDENTIFIER = com.maxgoedjen.SecretiveTests; - PRODUCT_NAME = "$(TARGET_NAME)"; - PROVISIONING_PROFILE_SPECIFIER = ""; - TEST_HOST = "$(BUILT_PRODUCTS_DIR)/Secretive.app/Contents/MacOS/Secretive"; - }; - name = Test; - }; 508A5917241EF1A00069DC07 /* Test */ = { isa = XCBuildConfiguration; buildSettings = { @@ -976,16 +843,6 @@ defaultConfigurationIsVisible = 0; defaultConfigurationName = Release; }; - 50617DA023FCE48E0099B055 /* Build configuration list for PBXNativeTarget "SecretiveTests" */ = { - isa = XCConfigurationList; - buildConfigurations = ( - 50617DA123FCE48E0099B055 /* Debug */, - 508A5916241EF1A00069DC07 /* Test */, - 50617DA223FCE48E0099B055 /* Release */, - ); - defaultConfigurationIsVisible = 0; - defaultConfigurationName = Release; - }; 50A3B79A24026B7600D209EA /* Build configuration list for PBXNativeTarget "SecretAgent" */ = { isa = XCConfigurationList; buildConfigurations = ( diff --git a/Sources/SecretiveTests/Info.plist b/Sources/SecretiveTests/Info.plist deleted file mode 100644 index 64d65ca..0000000 --- a/Sources/SecretiveTests/Info.plist +++ /dev/null @@ -1,22 +0,0 @@ - - - - - CFBundleDevelopmentRegion - $(DEVELOPMENT_LANGUAGE) - CFBundleExecutable - $(EXECUTABLE_NAME) - CFBundleIdentifier - $(PRODUCT_BUNDLE_IDENTIFIER) - CFBundleInfoDictionaryVersion - 6.0 - CFBundleName - $(PRODUCT_NAME) - CFBundlePackageType - $(PRODUCT_BUNDLE_PACKAGE_TYPE) - CFBundleShortVersionString - 1.0 - CFBundleVersion - 1 - - diff --git a/Sources/SecretiveTests/SecretiveTests.swift b/Sources/SecretiveTests/SecretiveTests.swift deleted file mode 100644 index d596a41..0000000 --- a/Sources/SecretiveTests/SecretiveTests.swift +++ /dev/null @@ -1,20 +0,0 @@ -import XCTest -@testable import Secretive - -class SecretiveTests: XCTestCase { - - override func setUp() { - // Put setup code here. This method is called before the invocation of each test method in the class. - } - - override func tearDown() { - // Put teardown code here. This method is called after the invocation of each test method in the class. - } - - func testExample() { - // This is an example of a functional test case. - // Use XCTAssert and related functions to verify your tests produce the correct results. - } - - -}