File tree Expand file tree Collapse file tree
Tests/AmoreLicensingTests Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -227,15 +227,13 @@ public final class AmoreLicensing: Licensing {
227227 status = . invalid
228228 }
229229 }
230-
231- /// The license a still-within-grace expired payload represents, with its
232- /// expiry extended to the grace deadline, or `nil` once grace has elapsed.
230+
231+ /// The license a still-within-grace expired payload represents, or `nil` once
232+ /// the grace period has elapsed.
233233 private func graceLicense ( for payload : LicensePayload ) -> License ? {
234234 let graceEnd = payload . exp . addingTimeInterval ( configuration . gracePeriod . timeInterval )
235235 guard graceEnd >= . now else { return nil }
236- var license = License ( from : payload )
237- license . expiresAt = graceEnd
238- return license
236+ return License ( from : payload )
239237 }
240238
241239 private func mapClientErrors < T > (
Original file line number Diff line number Diff line change @@ -210,8 +210,7 @@ import Testing
210210 Issue . record ( " Expected gracePeriod, got \( result ) " )
211211 return
212212 }
213- let expectedEnd = expDate . addingTimeInterval ( 7 * 86_400 )
214- #expect ( abs ( license . expiresAt ! . timeIntervalSince ( expectedEnd ) ) < 1 )
213+ #expect ( abs ( license . expiresAt ! . timeIntervalSince ( expDate ) ) < 1 )
215214 }
216215
217216 @ Test func validateExpiredTokenValidates ( ) async throws {
@@ -358,8 +357,7 @@ import Testing
358357 Issue . record ( " Expected gracePeriod on first synchronous read, got \( client . status ) " )
359358 return
360359 }
361- let expectedEnd = expDate . addingTimeInterval ( 7 * 86_400 )
362- #expect ( abs ( license . expiresAt ! . timeIntervalSince ( expectedEnd ) ) < 1 )
360+ #expect ( abs ( license . expiresAt ! . timeIntervalSince ( expDate ) ) < 1 )
363361 }
364362
365363 /// An expired token whose grace has already elapsed must stay `.unknown` at
You can’t perform that action at this time.
0 commit comments