diff --git a/Tests/GRDBTests/FoundationDateTests.swift b/Tests/GRDBTests/FoundationDateTests.swift index 920d15f01..6e0a29fef 100644 --- a/Tests/GRDBTests/FoundationDateTests.swift +++ b/Tests/GRDBTests/FoundationDateTests.swift @@ -179,7 +179,7 @@ class FoundationDateTests : GRDBTestCase { XCTAssertEqual(calendar.component(.hour, from: date), 1) XCTAssertEqual(calendar.component(.minute, from: date), 2) XCTAssertEqual(calendar.component(.second, from: date), 3) - XCTAssertTrue(abs(calendar.component(.nanosecond, from: date) - 4_000_000) < 10) // We actually get 4_000_008. Some precision is lost during the DateComponents -> Date conversion. Not a big deal. + XCTAssertTrue(abs(calendar.component(.nanosecond, from: date) - 4_560_000) < 10) } } @@ -259,7 +259,7 @@ class FoundationDateTests : GRDBTestCase { XCTAssertEqual(calendar.component(.hour, from: date), 1) XCTAssertEqual(calendar.component(.minute, from: date), 2) XCTAssertEqual(calendar.component(.second, from: date), 3) - XCTAssertTrue(abs(calendar.component(.nanosecond, from: date) - 4_000_000) < 10) // We actually get 4_000_008. Some precision is lost during the DateComponents -> Date conversion. Not a big deal. + XCTAssertTrue(abs(calendar.component(.nanosecond, from: date) - 4_560_000) < 10) } } } diff --git a/Tests/GRDBTests/FoundationNSDateTests.swift b/Tests/GRDBTests/FoundationNSDateTests.swift index ea43fb71f..0b3330c5e 100644 --- a/Tests/GRDBTests/FoundationNSDateTests.swift +++ b/Tests/GRDBTests/FoundationNSDateTests.swift @@ -162,7 +162,7 @@ class FoundationNSDateTests : GRDBTestCase { XCTAssertEqual(calendar.component(.hour, from: date as Date), 1) XCTAssertEqual(calendar.component(.minute, from: date as Date), 2) XCTAssertEqual(calendar.component(.second, from: date as Date), 3) - XCTAssertTrue(abs(calendar.component(.nanosecond, from: date as Date) - 4_000_000) < 10) // We actually get 4_000_008. Some precision is lost during the NSDateComponents -> NSDate conversion. Not a big deal. + XCTAssertTrue(abs(calendar.component(.nanosecond, from: date as Date) - 4_560_000) < 10) } } @@ -242,7 +242,7 @@ class FoundationNSDateTests : GRDBTestCase { XCTAssertEqual(calendar.component(.hour, from: date as Date), 1) XCTAssertEqual(calendar.component(.minute, from: date as Date), 2) XCTAssertEqual(calendar.component(.second, from: date as Date), 3) - XCTAssertTrue(abs(calendar.component(.nanosecond, from: date as Date) - 4_000_000) < 10) // We actually get 4_000_008. Some precision is lost during the NSDateComponents -> NSDate conversion. Not a big deal. + XCTAssertTrue(abs(calendar.component(.nanosecond, from: date as Date) - 4_560_000) < 10) } } }