mirror of https://github.com/vacp2p/nim-quic.git
Move stream tests into separate file
This commit is contained in:
parent
2709281696
commit
5e1ba19763
|
@ -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)
|
||||||
|
|
|
@ -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()
|
|
@ -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.}
|
||||||
|
|
Loading…
Reference in New Issue