Skip to content

Commit 54e9e04

Browse files
author
Shaun Hubbard
committed
changed channel names so they wouldnt hide as 32 bit words
1 parent 4435811 commit 54e9e04

File tree

1 file changed

+8
-9
lines changed

1 file changed

+8
-9
lines changed

Tests/PostgreSQLTests/PostgreSQLConnectionTests.swift

+8-9
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ class PostgreSQLConnectionTests: XCTestCase {
3333
for row in rows {
3434
try XCTAssert(
3535
row.firstValue(forColumn: "typlen")?.decode(Int.self) == 1 ||
36-
row.firstValue(forColumn: "typlen")?.decode(Int.self) == 2
36+
row.firstValue(forColumn: "typlen")?.decode(Int.self) == 2
3737
)
3838
}
3939
}
@@ -261,7 +261,7 @@ class PostgreSQLConnectionTests: XCTestCase {
261261
XCTAssertEqual(createResult.count, 0)
262262
let insertResult = try client.query("insert into foo values ($1, $2);", [
263263
Int32(1), Hello(message: "hello, world")
264-
]).wait()
264+
]).wait()
265265

266266
XCTAssertEqual(insertResult.count, 0)
267267
let parameterizedResult = try client.query("select * from foo").wait()
@@ -282,7 +282,7 @@ class PostgreSQLConnectionTests: XCTestCase {
282282
let insertResult = try client.query("insert into nulltest (i, d) VALUES ($1, $2)", [
283283
PostgreSQLData(type: .int2, format: .binary, data: Data([0x00, 0x01])),
284284
PostgreSQLData(type: .timestamp, format: .binary, data: nil),
285-
]).wait()
285+
]).wait()
286286
XCTAssertEqual(insertResult.count, 0)
287287
let parameterizedResult = try client.query("select * from nulltest").wait()
288288
XCTAssertEqual(parameterizedResult.count, 1)
@@ -348,7 +348,7 @@ class PostgreSQLConnectionTests: XCTestCase {
348348
let completionHandlerExpectation2 = expectation(description: "final completion handler called")
349349
let notifyConn = try PostgreSQLConnection.makeTest()
350350
let listenConn = try PostgreSQLConnection.makeTest()
351-
let channelName = "Foo"
351+
let channelName = "Fooze"
352352
let messageText = "Bar"
353353
let finalMessageText = "Baz"
354354

@@ -358,17 +358,16 @@ class PostgreSQLConnectionTests: XCTestCase {
358358
} else if text == finalMessageText {
359359
completionHandlerExpectation2.fulfill()
360360
}
361-
}.catch({ err in XCTFail("error \(err)") })
361+
}.catch({ err in XCTFail("error \(err)") })
362362

363363
try notifyConn.notify(channelName, message: messageText).wait()
364364
try notifyConn.notify(channelName, message: finalMessageText).wait()
365365

366+
waitForExpectations(timeout: defaultTimeout)
366367
notifyConn.close()
367368
listenConn.close()
368-
waitForExpectations(timeout: defaultTimeout)
369369
}
370370

371-
372371
func testURLParsing() throws {
373372
let databaseURL = "postgres://username:password@hostname.com:5432/database"
374373
let config = try PostgreSQLDatabaseConfig(url: databaseURL)
@@ -390,7 +389,7 @@ class PostgreSQLConnectionTests: XCTestCase {
390389
("testGH24", testGH24),
391390
("testNotifyAndListen", testNotifyAndListen),
392391
("testURLParsing", testURLParsing),
393-
]
392+
]
394393
}
395394

396395
extension PostgreSQLConnection {
@@ -406,7 +405,7 @@ extension PostgreSQLConnection {
406405
let group = MultiThreadedEventLoopGroup(numThreads: 1)
407406
let client = try PostgreSQLConnection.connect(hostname: hostname, on: group) { error in
408407
XCTFail("\(error)")
409-
}.wait()
408+
}.wait()
410409
_ = try client.authenticate(username: "vapor_username", database: "vapor_database", password: nil).wait()
411410
return client
412411
}

0 commit comments

Comments
 (0)