Skip to content

Commit

Permalink
Sync up LinuxMain.swift (hopefully)
Browse files Browse the repository at this point in the history
  • Loading branch information
jonblatho committed Jul 24, 2018
1 parent 30677df commit 44d6d59
Showing 1 changed file with 80 additions and 9 deletions.
89 changes: 80 additions & 9 deletions Tests/LinuxMain.swift
Original file line number Diff line number Diff line change
@@ -1,18 +1,51 @@
import XCTest
@testable import JWATests
@testable import JWTTests

extension HMACAlgorithmTests {
static var allTests: [(String, (HMACAlgorithmTests) -> () throws -> Void)] {
return [
("testSHA256Name", testSHA256Name),
("testSHA384Name", testSHA384Name),
("testSHA512Name", testSHA512Name),
("testSHA256Sign", testSHA256Sign),
("testSHA384Sign", testSHA384Sign),
("testSHA512Sign", testSHA512Sign),
("testSHA256Verify", testSHA256Verify),
("testSHA384Verify", testSHA384Verify),
("testSHA512Verify", testSHA512Verify)
]
}
}

extension EncodeTests {
static var allTests: [(String, (EncodeTests) -> (Void) throws -> Void)] {
extension NoneAlgorithmTests {
static var allTests: [(String, (NoneAlgorithmTests) -> () throws -> Void)] {
return [
("testEncodingJWT", testEncodingJWT),
("testEncodingWithBuilder", testEncodingWithBuilder),
("testName", testName),
("testSign", testSign),
("testVerify", testVerify)
]
}
}

extension CompactJSONDecoderTests {
static var allTests: [(String, (CompactJSONDecoderTests) -> () throws -> Void)] {
return [
("testDecoder", testDecoder)
]
}
}

extension CompactJSONEncoderTests {
static var allTests: [(String, (CompactJSONEncoderTests) -> () throws -> Void)] {
return [
("testEncode", testEncode)
]
}
}

extension DecodeTests {
static var allTests: [(String, (DecodeTests) -> (Void) throws -> Void)] {
static var allTests: [(String, (DecodeTests) -> () throws -> Void)] {
return [
("testDecodingValidJWT", testDecodingValidJWT),
("testFailsToDecodeInvalidStringWithoutThreeSegments", testFailsToDecodeInvalidStringWithoutThreeSegments),
Expand Down Expand Up @@ -40,26 +73,64 @@ extension DecodeTests {
("testNoneFailsWithSecretAlgorithm", testNoneFailsWithSecretAlgorithm),
("testMatchesAnyAlgorithm", testMatchesAnyAlgorithm),
("testHS384Algorithm", testHS384Algorithm),
("testHS512Algorithm", testHS512Algorithm),
("testHS512Algorithm", testHS512Algorithm)
]
}
}

extension IntegrationTests {
static var allTests: [(String, (IntegrationTests) -> () throws -> Void)] {
return [
("testVerificationFailureWithoutLeeway", testVerificationFailureWithoutLeeway),
("testVerificationSuccessWithLeeway", testVerificationSuccessWithLeeway)
]
}
}

extension JWTEncodeTests {
static var allTests: [(String, (JWTEncodeTests) -> () throws -> Void)] {
return [
("testEncodingJWT", testEncodingJWT),
("testEncodingWithBuilder", testEncodingWithBuilder),
("testEncodingClaimsWithHeaders", testEncodingClaimsWithHeaders)
]
}
}

extension PayloadTests {
static var allTests: [(String, (PayloadTests) -> (Void) throws -> Void)] {
static var allTests: [(String, (PayloadTests) -> () throws -> Void)] {
return [
("testIssuer", testIssuer),
("testAudience", testAudience),
("testExpiration", testExpiration),
("testNotBefore", testNotBefore),
("testIssuedAt", testIssuedAt),
("testCustomAttributes", testCustomAttributes),
("testCustomAttributes", testCustomAttributes)
]
}
}

extension ValidationTests {
static var allTests: [(String, (ValidationTests) -> () throws -> Void)] {
return [
("testClaimJustExpiredWithoutLeeway", testClaimJustExpiredWithoutLeeway),
("testClaimJustNotExpiredWithoutLeeway", testClaimJustNotExpiredWithoutLeeway),
("testNotBeforeIsImmatureSignatureWithoutLeeway", testNotBeforeIsImmatureSignatureWithoutLeeway),
("testNotBeforeIsValidWithLeeway", testNotBeforeIsValidWithLeeway),
("testIssuedAtIsInFutureWithoutLeeway", testIssuedAtIsInFutureWithoutLeeway),
("testIssuedAtIsValidWithLeeway", testIssuedAtIsValidWithLeeway)
]
}
}

XCTMain([
testCase(EncodeTests.allTests),
testCase(HMACAlgorithmTests.allTests),
testCase(NoneAlgorithmTests.allTests),
testCase(CompactJSONDecoder.allTests),
testCase(CompactJSONEncoder.allTests),
testCase(DecodeTests.allTests),
testCase(IntegrationTests.allTests),
testCase(JWTEncodeTests.allTests),
testCase(PayloadTests.allTests),
testCase(ValidationTests.allTests)
])

0 comments on commit 44d6d59

Please sign in to comment.