@@ -57,7 +57,12 @@ class DecodeTests: XCTestCase {
5757 let jwt = " eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJleHAiOjE3MjgxODg0OTF9.EW7k-8Mvnv0GpvOKJalFRLoCB3a3xGG3i7hAZZXNAz0 "
5858
5959 let claims = try JWT . decode ( jwt, algorithm: . hs256( " secret " . data ( using: . utf8) !) )
60- XCTAssertEqual ( claims. expiration? . timeIntervalSince1970, 1728188491 )
60+
61+ if let expirationClaim = claims. expiration? . timeIntervalSince1970 {
62+ XCTAssertEqual ( Int ( expirationClaim) , 1728188491 )
63+ } else {
64+ XCTFail ( )
65+ }
6166 }
6267
6368 func testUnexpiredClaimString( ) throws {
@@ -74,7 +79,11 @@ class DecodeTests: XCTestCase {
7479 let jwt = " eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJuYmYiOjE0MjgxODk3MjB9.jFT0nXAJvEwyG6R7CMJlzNJb7FtZGv30QRZpYam5cvs "
7580
7681 let claims = try JWT . decode ( jwt, algorithm: . hs256( " secret " . data ( using: . utf8) !) )
77- XCTAssertEqual ( claims. notBefore? . timeIntervalSince1970, 1428189720 )
82+ if let notBeforeClaim = claims. notBefore? . timeIntervalSince1970 {
83+ XCTAssertEqual ( Int ( notBeforeClaim) , 1428189720 )
84+ } else {
85+ XCTFail ( )
86+ }
7887 }
7988
8089 func testNotBeforeClaimString( ) throws {
@@ -101,7 +110,11 @@ class DecodeTests: XCTestCase {
101110 let jwt = " eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpYXQiOjE0MjgxODk3MjB9.I_5qjRcCUZVQdABLwG82CSuu2relSdIyJOyvXWUAJh4 "
102111
103112 let claims = try JWT . decode ( jwt, algorithm: . hs256( " secret " . data ( using: . utf8) !) )
104- XCTAssertEqual ( claims. issuedAt? . timeIntervalSince1970, 1428189720 )
113+ if let issuedAtClaim = claims. issuedAt? . timeIntervalSince1970 {
114+ XCTAssertEqual ( Int ( issuedAtClaim) , 1428189720 )
115+ } else {
116+ XCTFail ( )
117+ }
105118 }
106119
107120 func testIssuedAtClaimInThePastString( ) throws {
0 commit comments