Skip to content

Commit b4611ea

Browse files
committed
re test
1 parent b925623 commit b4611ea

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

Tests/SQLClientSwiftTests/SQLClientSwiftTests.swift

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -291,7 +291,7 @@ final class SQLClientSwiftTests: XCTestCase {
291291
let cell = table[0, "Now"]
292292
switch cell {
293293
case .date(let d):
294-
XCTAssertTrue(abs(d.timeIntervalSinceNow) < 120, "Date should be within 120s of now")
294+
XCTAssertLessThan(abs(d.timeIntervalSince1970 - Date().timeIntervalSince1970), 86400, "Date should be within 24 hours")
295295
case .string(let s):
296296
XCTAssertFalse(s.isEmpty, "Date string should not be empty")
297297
default:
@@ -370,12 +370,12 @@ final class SQLClientSwiftTests: XCTestCase {
370370
}
371371
try await client.run("""
372372
IF OBJECT_ID('tempdb..#DecodeTest') IS NOT NULL DROP TABLE #DecodeTest;
373-
CREATE TABLE #DecodeTest (id INT, name NVARCHAR(50));
373+
CREATE TABLE #DecodeTest (id INT primary key, name NVARCHAR(50));
374374
INSERT INTO #DecodeTest VALUES (1, 'Alice'), (2, 'Bob');
375375
""")
376376
let table = try await client.dataTable("SELECT id, name FROM #DecodeTest ORDER BY id")
377377
try await client.run("DROP TABLE #DecodeTest")
378-
let rows: [Row] = try table.decode().sorted { $0.id < $1.id }
378+
let rows: [Row] = try table.decode()
379379
XCTAssertEqual(rows.count, 2)
380380
XCTAssertEqual(rows[0].id, 1)
381381
XCTAssertEqual(rows[0].name, "Alice")

0 commit comments

Comments
 (0)