Skip to content

Commit 09778e0

Browse files
authored
Clean up incorrect comments and test behaviour (#96)
Motivation: The recently added test asserted something about the behaviour of the code that was not true: I was just holding the test wrong. Modifications: Fix the test, remove the comment. Result: Things are better now
1 parent e212169 commit 09778e0

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

Tests/NIOSSHTests/ChildChannelMultiplexerTests.swift

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1244,7 +1244,7 @@ final class ChildChannelMultiplexerTests: XCTestCase {
12441244
return channel.setOption(ChannelOptions.autoRead, value: false)
12451245
}
12461246

1247-
guard let channel = childChannel else {
1247+
guard childChannel != nil else {
12481248
XCTFail("Did not create child channel")
12491249
return
12501250
}
@@ -1267,9 +1267,10 @@ final class ChildChannelMultiplexerTests: XCTestCase {
12671267
// Now we send a close message. This is going to forcibly close the channel immediately.
12681268
XCTAssertNoThrow(try harness.multiplexer.receiveMessage(self.close(peerChannelID: channelID!)))
12691269

1270-
// This should trigger no message.
1271-
// (Actually, it should trigger a close, but that's a different bug and to be fixed in a different patch.)
1272-
XCTAssertEqual(harness.flushedMessages.count, 1)
1270+
// This should trigger a close and nothing else.
1271+
harness.multiplexer.parentChannelReadComplete()
1272+
XCTAssertEqual(harness.flushedMessages.count, 2)
1273+
self.assertChannelClose(harness.flushedMessages.last, recipientChannel: 1)
12731274
}
12741275

12751276
func testRespectingMaxMessageSize() throws {

0 commit comments

Comments
 (0)