diff --git a/Tests/AWSLambdaEventsTests/S3Tests.swift b/Tests/AWSLambdaEventsTests/S3Tests.swift index 94a89ae..b386a15 100644 --- a/Tests/AWSLambdaEventsTests/S3Tests.swift +++ b/Tests/AWSLambdaEventsTests/S3Tests.swift @@ -112,6 +112,8 @@ struct S3Tests { #expect(record.awsRegion == .eu_central_1) #expect(record.eventName == "ObjectCreated:Put") #expect(record.eventTime.ISO8601Format() == Date(timeIntervalSince1970: 1_578_907_540.621).ISO8601Format()) + // see https://github.com/swiftlang/swift-foundation/issues/1561#issuecomment-3448853449 + #expect(abs(record.eventTime.timeIntervalSince1970 - 1_578_907_540.621) < 0.0005) #expect(record.userIdentity == S3Event.UserIdentity(principalId: "AWS:AAAAAAAJ2MQ4YFQZ7AULJ")) #expect(record.requestParameters == S3Event.RequestParameters(sourceIPAddress: "123.123.123.123")) #expect(record.responseElements.count == 2) @@ -136,6 +138,8 @@ struct S3Tests { #expect(record.awsRegion == .eu_central_1) #expect(record.eventName == "ObjectRemoved:DeleteMarkerCreated") #expect(record.eventTime.ISO8601Format() == Date(timeIntervalSince1970: 1_578_907_540.621).ISO8601Format()) + // see https://github.com/swiftlang/swift-foundation/issues/1561#issuecomment-3448853449 + #expect(abs(record.eventTime.timeIntervalSince1970 - 1_578_907_540.621) < 0.0005) #expect(record.userIdentity == S3Event.UserIdentity(principalId: "AWS:AAAAAAAJ2MQ4YFQZ7AULJ")) #expect(record.requestParameters == S3Event.RequestParameters(sourceIPAddress: "123.123.123.123")) #expect(record.responseElements.count == 2) diff --git a/Tests/AWSLambdaEventsTests/Utils/DateWrapperTests.swift b/Tests/AWSLambdaEventsTests/Utils/DateWrapperTests.swift index 3955582..8f880b5 100644 --- a/Tests/AWSLambdaEventsTests/Utils/DateWrapperTests.swift +++ b/Tests/AWSLambdaEventsTests/Utils/DateWrapperTests.swift @@ -68,7 +68,11 @@ struct DateWrapperTests { #if swift(<6.2) let error = (any Error).self #else + #if canImport(FoundationEssentials) let error = Never.self + #else + let error = (any Error).self + #endif #endif #expect(throws: error) { try JSONDecoder().decode(TestEvent.self, from: json.data(using: .utf8)!)