Permalink
Browse files

Add tests for using the Task PMC from nqp

  • Loading branch information...
1 parent 4a11ee1 commit de6533650fcadcc64016072538a03ecd3cc81709 @leto leto committed Sep 29, 2012
Showing with 34 additions and 0 deletions.
  1. +34 −0 t/pmc/task-nqp.t
View
@@ -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:
+

0 comments on commit de65336

Please sign in to comment.