Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Add tests for using the Task PMC from nqp

  • Loading branch information...
commit de6533650fcadcc64016072538a03ecd3cc81709 1 parent 4a11ee1
@leto leto authored
Showing with 34 additions and 0 deletions.
  1. +34 −0 t/pmc/task-nqp.t
View
34 t/pmc/task-nqp.t
@@ -0,0 +1,34 @@
+#!./parrot-nqp
+# Copyright (C) 2012, Parrot Foundation.
+
+Q:PIR {
+ # We want Test::More features for testing. Not NQP's builtin.
+ .include "test_more.pir"
+ load_bytecode "dumper.pbc"
+};
+
+plan(2);
+
+my $x := 5;
+
+my $sub := sub foo() {
+ $x++;
+ ok(1, 'sub sucessfully called from Task');
+}
+
+my $task := pir::new__PSP('Task', $sub);
+
+ok(1, 'created a Task PMC from nqp');
+
+pir::schedule__0P($task);
+ok(1, 'scheduled a task');
+pir::wait__0P($task);
+
+ok(1,'wait on a task');
+
+# Local Variables:
+# mode: nqp
+# fill-column: 100
+# End:
+# vim: expandtab shiftwidth=4 ft=pir:
+
Please sign in to comment.
Something went wrong with that request. Please try again.