aboutsummaryrefslogtreecommitdiff
path: root/tests/actor/accept/failed_worker.zc
diff options
context:
space:
mode:
Diffstat (limited to 'tests/actor/accept/failed_worker.zc')
-rw-r--r--tests/actor/accept/failed_worker.zc11
1 files changed, 11 insertions, 0 deletions
diff --git a/tests/actor/accept/failed_worker.zc b/tests/actor/accept/failed_worker.zc
new file mode 100644
index 0000000..056a6b6
--- /dev/null
+++ b/tests/actor/accept/failed_worker.zc
@@ -0,0 +1,11 @@
+namespace;
+include rt, actor;
+typecheck on;
+int fail(int n) { rt.syscall(7, 2, 0, 0); return n; }
+int healthy(int n) { return n + 1; }
+fn main() {
+ actor.Actor<int,int>* a = rt.new(actor.Actor<int,int>); a.spawn(fail); a.recv(fn(int n) { return 0; }); a.send(1);
+ rt.put_n(a.await()); rt.put_c(' '); rt.put_n(a.send(2)); rt.put_c(' '); a.close();
+ actor.Actor<int,int>* b = rt.new(actor.Actor<int,int>); let result = 0; b.spawn(healthy); b.recv(fn(int n) { result = n; return 0; }); b.send(2); b.await();
+ rt.put_n(result); rt.put_c(10); b.close(); return 0;
+}