File tree Expand file tree Collapse file tree 1 file changed +11
-2
lines changed
Tests/PostgresNIOTests/New Expand file tree Collapse file tree 1 file changed +11
-2
lines changed Original file line number Diff line number Diff line change @@ -19,6 +19,9 @@ final class PSQLRowStreamTests: XCTestCase {
1919
2020 XCTAssertEqual ( try stream. all ( ) . wait ( ) , [ ] )
2121 XCTAssertEqual ( stream. commandTag, " INSERT 0 1 " )
22+
23+ // Test 'drain' works in this case
24+ XCTAssertNoThrow ( try stream. drain ( ) . wait ( ) )
2225 }
2326
2427 func testFailedStream( ) {
@@ -27,9 +30,15 @@ final class PSQLRowStreamTests: XCTestCase {
2730 eventLoop: self . eventLoop,
2831 logger: self . logger
2932 )
30-
33+
34+ let expectedError = PSQLError . serverClosedConnection ( underlying: nil )
35+
3136 XCTAssertThrowsError ( try stream. all ( ) . wait ( ) ) {
32- XCTAssertEqual ( $0 as? PSQLError , . serverClosedConnection( underlying: nil ) )
37+ XCTAssertEqual ( $0 as? PSQLError , expectedError)
38+ }
39+
40+ XCTAssertThrowsError ( try stream. drain ( ) . wait ( ) ) {
41+ XCTAssertEqual ( $0 as? PSQLError , expectedError)
3342 }
3443 }
3544
You can’t perform that action at this time.
0 commit comments