Convert all tests to single-file packages.
This commit is contained in:
parent
c08f101549
commit
cd3e756dd6
8 changed files with 115 additions and 10 deletions
38
tests/vibe.core.net.1441.d
Normal file
38
tests/vibe.core.net.1441.d
Normal file
|
@ -0,0 +1,38 @@
|
|||
/++ dub.sdl:
|
||||
name "test"
|
||||
description "TCP disconnect task issue"
|
||||
dependency "vibe-core" path="../../"
|
||||
+/
|
||||
module test;
|
||||
|
||||
import vibe.core.core;
|
||||
import vibe.core.net;
|
||||
import core.time : msecs;
|
||||
import std.string : representation;
|
||||
|
||||
void main()
|
||||
{
|
||||
import vibe.core.log;
|
||||
bool done = false;
|
||||
listenTCP(11375, (conn) {
|
||||
try {
|
||||
conn.write("foo".representation);
|
||||
conn.close();
|
||||
} catch (Exception e) {
|
||||
assert(false, e.msg);
|
||||
}
|
||||
done = true;
|
||||
});
|
||||
|
||||
runTask({
|
||||
auto conn = connectTCP("127.0.0.1", 11375);
|
||||
conn.close();
|
||||
|
||||
sleep(50.msecs);
|
||||
assert(done);
|
||||
|
||||
exitEventLoop();
|
||||
});
|
||||
|
||||
runEventLoop();
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue