From 6086f3fdcaa7f8bf16606fb82119b07e21218be8 Mon Sep 17 00:00:00 2001 From: Gwynne Raskind Date: Fri, 15 Sep 2023 13:22:00 -0500 Subject: [PATCH] Tweak test to remove need for a platform conditional --- Tests/SQLiteNIOTests/SQLiteCustomFunctionTests.swift | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/Tests/SQLiteNIOTests/SQLiteCustomFunctionTests.swift b/Tests/SQLiteNIOTests/SQLiteCustomFunctionTests.swift index f3464b0..0016853 100644 --- a/Tests/SQLiteNIOTests/SQLiteCustomFunctionTests.swift +++ b/Tests/SQLiteNIOTests/SQLiteCustomFunctionTests.swift @@ -315,7 +315,7 @@ class DatabaseFunctionTests: XCTestCase { let conn = try SQLiteConnection.open(storage: .memory, threadPool: self.threadPool, on: self.eventLoop).wait() defer { try! conn.close().wait() } let fn = SQLiteCustomFunction("f") { _ in - throw NSError(domain: "CustomErrorDomain", code: 123, userInfo: [NSLocalizedDescriptionKey: "custom error message"]) + throw NSError(domain: "CustomErrorDomain", code: 123, userInfo: [NSLocalizedDescriptionKey: "custom error message", NSLocalizedFailureReasonErrorKey: "custom error message"]) } try conn.install(customFunction: fn).wait() @@ -324,15 +324,10 @@ class DatabaseFunctionTests: XCTestCase { _ = try conn.query("SELECT f()").wait() XCTFail("Expected Error") } catch let error as SQLiteError { - XCTAssertEqual(error.reason, .error) XCTAssertTrue(error.message.contains("CustomErrorDomain")) XCTAssertTrue(error.message.contains("123")) - #if os(Linux) - XCTAssertTrue(error.message.contains("(null)"), "expected '\(error.message)' to contain '(null)'") - #else XCTAssertTrue(error.message.contains("custom error message"), "expected '\(error.message)' to contain 'custom error message'") - #endif } }