forked from kylef/JSONWebToken.swift
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathLinuxMain.swift
65 lines (60 loc) · 2.5 KB
/
LinuxMain.swift
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
import XCTest
@testable import JWTTests
extension EncodeTests {
static var allTests: [(String, (EncodeTests) -> Void throws -> Void)] {
return [
("testEncodingJWT", testEncodingJWT),
("testEncodingWithBuilder", testEncodingWithBuilder),
]
}
}
extension DecodeTests {
static var allTests: [(String, (DecodeTests) -> Void throws -> Void)] {
return [
("testDecodingValidJWT", testDecodingValidJWT),
("testFailsToDecodeInvalidStringWithoutThreeSegments", testFailsToDecodeInvalidStringWithoutThreeSegments),
("testDisablingVerify", testDisablingVerify),
("testSuccessfulIssuerValidation", testSuccessfulIssuerValidation),
("testIncorrectIssuerValidation", testIncorrectIssuerValidation),
("testMissingIssuerValidation", testMissingIssuerValidation),
("testExpiredClaim", testExpiredClaim),
("testInvalidExpiaryClaim", testInvalidExpiaryClaim),
("testUnexpiredClaim", testUnexpiredClaim),
("testUnexpiredClaimString", testUnexpiredClaimString),
("testNotBeforeClaim", testNotBeforeClaim),
("testNotBeforeClaimString", testNotBeforeClaimString),
("testInvalidNotBeforeClaim", testInvalidNotBeforeClaim),
("testUnmetNotBeforeClaim", testUnmetNotBeforeClaim),
("testIssuedAtClaimInThePast", testIssuedAtClaimInThePast),
("testIssuedAtClaimInThePastString", testIssuedAtClaimInThePastString),
("testIssuedAtClaimInTheFuture", testIssuedAtClaimInTheFuture),
("testInvalidIssuedAtClaim", testInvalidIssuedAtClaim),
("testAudiencesClaim", testAudiencesClaim),
("testAudienceClaim", testAudienceClaim),
("testMismatchAudienceClaim", testMismatchAudienceClaim),
("testMissingAudienceClaim", testMissingAudienceClaim),
("testNoneAlgorithm", testNoneAlgorithm),
("testNoneFailsWithSecretAlgorithm", testNoneFailsWithSecretAlgorithm),
("testMatchesAnyAlgorithm", testMatchesAnyAlgorithm),
("testHS384Algorithm", testHS384Algorithm),
("testHS512Algorithm", testHS512Algorithm),
]
}
}
extension PayloadTests {
static var allTests: [(String, (PayloadTests) -> Void throws -> Void)] {
return [
("testIssuer", testIssuer),
("testAudience", testAudience),
("testExpiration", testExpiration),
("testNotBefore", testNotBefore),
("testIssuedAt", testIssuedAt),
("testCustomAttributes", testCustomAttributes),
]
}
}
XCTMain([
testCase(EncodeTests.allTests),
testCase(DecodeTests.allTests),
testCase(PayloadTests.allTests),
])