use v6-alpha; use Test; =kwid = DESCRIPTION This test tests the interaction of C and C. Ideally, while a C call is in progress, C blocks are still being executed. =cut plan 1; diag "Running under $*OS"; my @events; my $event_count = 4; sub spawn_counter () { async { my $count = $event_count; while ($count--) { diag $count; push @events, time(); sleep 1; # five seconds are enough for everybody }; }; }; my ($pugs,$redir) = ("./pugs", ">"); ok(0, "async+system known to be erratic _everywhere_, disable for now", :todo); exit; if $?OS eq any { $pugs = 'pugs.exe'; skip 1, "async known to be problematic on Win32"; exit; }; diag "Spawning counter"; spawn_counter(); system( qq!$pugs -e "sleep(5)"!); if (!ok(@events == $event_count, "Our async counter finished while we were running a subprocess")) { diag "Got " ~ +@events ~ " element(s)."; diag "Expected $event_count elements." };