From 41c18aef743cdca2e0538c4ce804f21bd632a81c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=B6nke=20Ludwig?= Date: Sun, 16 Jun 2019 21:30:18 +0200 Subject: [PATCH] Add test for issue #161. --- tests/issue-161-multiple-joiners.d | 31 ++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) create mode 100644 tests/issue-161-multiple-joiners.d diff --git a/tests/issue-161-multiple-joiners.d b/tests/issue-161-multiple-joiners.d new file mode 100644 index 0000000..c0ebc78 --- /dev/null +++ b/tests/issue-161-multiple-joiners.d @@ -0,0 +1,31 @@ +/+ dub.sdl: + name "tests" + dependency "vibe-core" path=".." + debugVersions "VibeTaskLog" "VibeAsyncLog" ++/ +module tests; + +import vibe.core.core; +import vibe.core.log; +import vibe.core.sync; +import core.time; +import core.stdc.stdlib : exit; + + +void main() +{ + setTimer(5.seconds, { logError("Test has hung."); exit(1); }); + + Task t; + + runTask({ + t = runTask({ sleep(100.msecs); }); + t.join(); + }); + + yield(); + + assert(t && t.running); + + t.join(); +}