2 # Copyright (C) 2007, Parrot Foundation.
7 use lib qw( . lib ../lib ../../lib );
9 use Parrot::Test tests => 3;
13 t/pmc/task.t - Concurrent Task
21 Tests the task PMC used by the concurrency scheduler.
25 pir_output_is( <<'CODE', <<'OUT', "create a task and set attributes" );
28 $P1 = getattribute $P0, 'status'
34 setattribute $P0, 'status', $P2
36 $P3 = getattribute $P0, 'status'
42 setattribute $P0, 'type', $P2
44 $P3 = getattribute $P0, 'type'
50 setattribute $P0, 'priority', $P2
52 $P3 = getattribute $P0, 'priority'
58 setattribute $P0, 'id', $P2
60 $P3 = getattribute $P0, 'id'
66 setattribute $P0, 'birthtime', $P2
68 $P3 = getattribute $P0, 'birthtime'
82 pir_output_is( <<'CODE', <<'OUT', 'create a task and set attributes in init' );
97 data['priority'] = $P2
105 data['birthtime'] = $P2
107 $P0 = new ['Task'], data
109 $P3 = getattribute $P0, 'status'
112 $P3 = getattribute $P0, 'type'
115 $P3 = getattribute $P0, 'priority'
118 $P3 = getattribute $P0, 'id'
121 $P3 = getattribute $P0, 'birthtime'
133 pir_output_is( <<'CODE', <<'OUT', "freeze and thaw a task" );
139 setattribute $P0, 'status', $P2
143 setattribute $P0, 'type', $P2
145 $P2 = new ['Integer']
147 setattribute $P0, 'priority', $P2
149 $P2 = new ['Integer']
151 setattribute $P0, 'id', $P2
155 setattribute $P0, 'birthtime', $P2
160 $P3 = getattribute $P10, 'status'
164 $P3 = getattribute $P10, 'type'
168 $P3 = getattribute $P10, 'priority'
172 $P3 = getattribute $P10, 'id'
176 $P3 = getattribute $P10, 'birthtime'
191 # cperl-indent-level: 4
194 # vim: expandtab shiftwidth=4: