From 717262c0a6520c487bef0ee8b2081b551c62cf62 Mon Sep 17 00:00:00 2001 From: Ayke van Laethem Date: Sat, 29 Sep 2018 00:11:58 +0200 Subject: [PATCH] main: add coroutine/sleep tests --- testdata/coroutines.go | 18 ++++++++++++++++++ testdata/coroutines.txt | 5 +++++ 2 files changed, 23 insertions(+) create mode 100644 testdata/coroutines.go create mode 100644 testdata/coroutines.txt diff --git a/testdata/coroutines.go b/testdata/coroutines.go new file mode 100644 index 00000000..18b1c0a8 --- /dev/null +++ b/testdata/coroutines.go @@ -0,0 +1,18 @@ +package main + +import "time" + +func main() { + println("main 1") + go sub() + time.Sleep(1 * time.Millisecond) + println("main 2") + time.Sleep(2 * time.Millisecond) + println("main 3") +} + +func sub() { + println("sub 1") + time.Sleep(2 * time.Millisecond) + println("sub 2") +} diff --git a/testdata/coroutines.txt b/testdata/coroutines.txt new file mode 100644 index 00000000..c8b209da --- /dev/null +++ b/testdata/coroutines.txt @@ -0,0 +1,5 @@ +main 1 +sub 1 +main 2 +sub 2 +main 3