Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
pugs fudge
  • Loading branch information
coke committed Jul 9, 2012
1 parent 997c786 commit d9800ad
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 7 deletions.
2 changes: 2 additions & 0 deletions S03-operators/relational.t
Expand Up @@ -158,6 +158,7 @@ is(7 < 2.4, False, 'Int < Rat');
is(7 <= 2.4, False, 'Int <= Rat');
is(7 > 2.4, True , 'Int > Rat');
is(7 >= 2.4, True , 'Int >= Rat');
#?pugs skip 'Order enum'
is(7 <=> 2.4, Order::Decrease, 'Int <=> Rat');
# Rat,Int comparisons
Expand All @@ -167,6 +168,7 @@ is(2.4 < 7, True , 'Rat < Int');
is(2.4 <= 7, True , 'Rat <= Int');
is(2.4 > 7, False, 'Rat > Int');
is(2.4 >= 7, False, 'Rat >= Int');
#?pugs skip 'Order enum'
is(2.4 <=> 7, Order::Increase, 'Rat <=> Int');
done;
Expand Down
18 changes: 11 additions & 7 deletions S17-async/async.t
Expand Up @@ -38,32 +38,36 @@ sub do_something_very_important {
}

my @threads;
#?pugs skip 'async tests report wrong number sometimes'
@threads[0] = async { ok do_something_very_important(),'very important things from first thread' };
#?pugs skip 'async tests report wrong number sometimes'
@threads[1] = async { ok do_something_very_important(),'very important things from second thread' };


#?pugs skip 'async tests report wrong number sometimes'
ok @threads[0].join,'first thread joined';
#?pugs skip 'async tests report wrong number sometimes'
ok @threads[1].join,'second thread joined';
# currently a second join on a joined thread waits forever; not good
#?pugs todo 'unimpl'
#?pugs skip 'async tests report wrong number sometimes'
ok eval q{#!@threads[1].join},'second thread not joinable again';

# L<S17/"Thread methods"/"=item detach">
#?pugs todo 'unimpl'
#?pugs skip 'async tests report wrong number sometimes'
@threads[2] = async { ok do_something_very_important(),'again start a thread' };
#?pugs skip 'async tests report wrong number sometimes'
ok eval q{threads[2].detach},'detach a thread';
#?pugs todo 'unimpl'
#?pugs skip 'async tests report wrong number sometimes'
ok !@threads[2].join,'could not join a detached thread';

# L<S17/"Thread methods"/"=item suspend">
#?pugs skip 'unimpl'
#?pugs skip 'async tests report wrong number sometimes'
@threads[3] = async { ok do_something_very_important(),'another thread' };
#?pugs todo 'unimpl'
#?pugs skip 'async tests report wrong number sometimes'
ok eval q{@threads[3].suspend},' send him back to a waiting room..';

# L<S17/"Thread methods"/"=item resume">
#?pugs todo 'unimpl'
#?pugs skip 'async tests report wrong number sometimes'
ok eval q{@threads[3].resume},'... now he is back';


# vim: ft=perl6
1 change: 1 addition & 0 deletions S17-async/contend.t
Expand Up @@ -31,6 +31,7 @@ is +@thr, 2, 'one thousand threads';

for @thr { .join(); }; # all threads back

#?pugs skip 'race condition hits about 50% of the time'
ok $counter < 1000, 'the race condition strikes' or diag($counter);


Expand Down

0 comments on commit d9800ad

Please sign in to comment.