Move stream tests into separate file

This commit is contained in:
Mark Spanbroek 2020-10-27 08:59:33 +01:00 committed by markspanbroek
parent 2709281696
commit 5e1ba19763
3 changed files with 18 additions and 11 deletions

View File

@ -13,17 +13,6 @@ suite "connection":
check client.isHandshakeCompleted check client.isHandshakeCompleted
check server.isHandshakeCompleted check server.isHandshakeCompleted
test "opens uni-directional streams":
let (client, _) = performHandshake()
check client.openStream() != client.openStream()
test "raises error when opening uni-directional stream fails":
let client = newClientConnection(zeroAddress, zeroAddress)
expect IOError:
discard client.openStream()
test "raises error when reading datagram fails": test "raises error when reading datagram fails":
let datagram = repeat(0'u8, 4096) let datagram = repeat(0'u8, 4096)
let server = newServerConnection(zeroAddress, zeroAddress, datagram) let server = newServerConnection(zeroAddress, zeroAddress, datagram)

View File

@ -0,0 +1,17 @@
import unittest
import quic
import ../helpers/connections
import ../helpers/addresses
suite "streams":
test "opens uni-directional streams":
let (client, _) = performHandshake()
check client.openStream() != client.openStream()
test "raises error when opening uni-directional stream fails":
let client = newClientConnection(zeroAddress, zeroAddress)
expect IOError:
discard client.openStream()

View File

@ -8,5 +8,6 @@ import quic/testVarInts
import quic/testPacketNumber import quic/testPacketNumber
import quic/testConnection import quic/testConnection
import quic/testConnectionId import quic/testConnectionId
import quic/testStreams
{.warning[UnusedImport]:off.} {.warning[UnusedImport]:off.}