From 65dbec72b24d2934384efaebc44f1d821dfc9759 Mon Sep 17 00:00:00 2001 From: =?utf8?q?J=C3=A9r=C3=A9mie=20Astor?= Date: Wed, 6 May 2020 19:38:46 +0200 Subject: [PATCH] :white_check_mark: test forks --- tests/fork/fork.gw | 11 +++++++++++ tests/fork/fork_clean.gw | 1 + tests/fork/fork_in_fork.gw | 10 ++++++++++ tests/fork/fork_join.gw | 3 +++ tests/fork/fork_join2.gw | 2 ++ 5 files changed, 27 insertions(+) create mode 100644 tests/fork/fork.gw create mode 100644 tests/fork/fork_clean.gw create mode 100644 tests/fork/fork_in_fork.gw create mode 100644 tests/fork/fork_join.gw create mode 100644 tests/fork/fork_join2.gw diff --git a/tests/fork/fork.gw b/tests/fork/fork.gw new file mode 100644 index 00000000..63256ea8 --- /dev/null +++ b/tests/fork/fork.gw @@ -0,0 +1,11 @@ +fork { + <<< "start" >>>; + 12::samp => now; + me.test_cancel(); + <<< "stop" >>>; +} @=> Fork ref f; + +1 => f.set_cancel; +2::samp => now; +0 => f.set_cancel; +f.join(); diff --git a/tests/fork/fork_clean.gw b/tests/fork/fork_clean.gw new file mode 100644 index 00000000..4e6877b3 --- /dev/null +++ b/tests/fork/fork_clean.gw @@ -0,0 +1 @@ +fork { <<< __func__ >>>; second => now; }; diff --git a/tests/fork/fork_in_fork.gw b/tests/fork/fork_in_fork.gw new file mode 100644 index 00000000..f75af956 --- /dev/null +++ b/tests/fork/fork_in_fork.gw @@ -0,0 +1,10 @@ +fork { + fork { + <<< __func__ >>>; + second => now; + }; + <<< __func__ >>>; + second => now; +}; + +samp => now; diff --git a/tests/fork/fork_join.gw b/tests/fork/fork_join.gw new file mode 100644 index 00000000..e0b85d7e --- /dev/null +++ b/tests/fork/fork_join.gw @@ -0,0 +1,3 @@ +fork { <<< __func__ >>>; } @=> Fork ref f; +second => now; +f.join(); diff --git a/tests/fork/fork_join2.gw b/tests/fork/fork_join2.gw new file mode 100644 index 00000000..dd8d58f0 --- /dev/null +++ b/tests/fork/fork_join2.gw @@ -0,0 +1,2 @@ +fork { <<< __func__ >>>; minute => now; } @=> Fork ref f; +f.join(); -- 2.43.0