File tree Expand file tree Collapse file tree 1 file changed +2
-12
lines changed Expand file tree Collapse file tree 1 file changed +2
-12
lines changed Original file line number Diff line number Diff line change @@ -70,18 +70,8 @@ final class SQLiteNIOTests: XCTestCase {
70
70
71
71
func testTimestampStorage( ) async throws {
72
72
try await withOpenedConnection { conn in
73
- let date = Date ( )
74
- let rows = try await conn. query ( " SELECT ? as date " , [ date. sqliteData!] )
75
- XCTAssertEqual ( rows. first? . column ( " date " ) , . float( date. timeIntervalSince1970) )
76
- XCTAssertEqual ( rows. first? . column ( " date " ) . flatMap ( Date . init ( sqliteData: ) ) ? . description, date. description)
77
- XCTAssertEqual ( rows. first? . column ( " date " ) . flatMap ( Date . init ( sqliteData: ) ) , date)
78
- XCTAssertEqual ( rows. first? . column ( " date " ) . flatMap ( Date . init ( sqliteData: ) ) ? . timeIntervalSinceReferenceDate, date. timeIntervalSinceReferenceDate)
79
- }
80
- }
81
-
82
- func testTimestampStorageRoundToMicroseconds( ) async throws {
83
- try await withOpenedConnection { conn in
84
- // Test value that when read back out of sqlite results in 7 decimal places that we need to round to microseconds
73
+ // When the value is read back out of sqlite, it will have only microsecond precision, make sure we use a Date with
74
+ // the same limit or else the test will fail.
85
75
let date = Date ( timeIntervalSinceReferenceDate: 689658914.293192 )
86
76
let rows = try await conn. query ( " SELECT ? as date " , [ date. sqliteData!] )
87
77
XCTAssertEqual ( rows. first? . column ( " date " ) , . float( date. timeIntervalSince1970) )
You can’t perform that action at this time.
0 commit comments