Skip to content

Commit 8cd805f

Browse files
committed
[skip ci] Tweak test to be compatible with multiple PSQLError representations
1 parent bb3ab8e commit 8cd805f

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

Tests/FluentPostgresDriverTests/FluentPostgresTransactionControlTests.swift

+2-2
Original file line numberDiff line numberDiff line change
@@ -24,10 +24,10 @@ final class FluentPostgresTransactionControlTests: XCTestCase {
2424
}
2525
}.wait()
2626
XCTFail("Expected error but none was thrown")
27-
} catch let error as PSQLError where error.code == .server && error.serverInfo?[.sqlState] == "23505" {
27+
} catch let error where String(reflecting: error).contains("sqlState: 23505") {
2828
// ignore
2929
} catch {
30-
XCTFail("Expected SQL state 23505 but got \(error)")
30+
XCTFail("Expected SQL state 23505 but got \(String(reflecting: error))")
3131
}
3232

3333
let count2 = try Todo.query(on: self.db).count().wait()

0 commit comments

Comments
 (0)