-
-
Notifications
You must be signed in to change notification settings - Fork 160
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
e332b7c
commit 8e70754
Showing
9 changed files
with
120 additions
and
298 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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) | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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) | ||
} | ||
|
||
} |
Oops, something went wrong.