--- Coro/t/00_basic.t 2006/12/04 21:56:00 1.7 +++ Coro/t/00_basic.t 2007/10/03 16:03:17 1.10 @@ -1,39 +1,38 @@ -BEGIN { $| = 1; print "1..8\n"; } +BEGIN { $| = 1; print "1..9\n"; } END {print "not ok 1\n" unless $loaded;} use Coro::State; $loaded = 1; print "ok 1\n"; my $main = new Coro::State; -my $proc = new Coro::State \&a; -my $proc2 = new Coro::State \&b; +my $proca = new Coro::State \&a; +my $procb = new Coro::State \&b; sub a { + print $/ eq "\n" ? "" : "not ", "ok 3\n"; $/ = 77; - print "ok 3\n"; - $proc->transfer ($main); - print $/ == 77 ? "" : "not ", "ok 5\n"; - $proc->transfer ($main); - print "not ok 6\n"; + print "ok 4\n"; + $proca->transfer ($main); + print $/ == 77 ? "" : "not ", "ok 6\n"; + $proca->transfer ($main); + print "not ok 7\n"; die; } sub b { - print $/ != 55 ? "not " : "", "ok 7\n"; - $proc2->transfer ($main); - print "not ok 8\n"; + print $/ ne "\n" ? "not " : "", "ok 8\n"; + $procb->transfer ($main); + print "not ok 9\n"; die; } -$proc2->save (0); - $/ = 55; print "ok 2\n"; -$main->transfer ($proc); -print $/ != 55 ? "not " : "ok 4\n"; -$main->transfer ($proc); -print $/ != 55 ? "not " : "ok 6\n"; -$main->transfer ($proc2); -print $/ != 55 ? "not " : "ok 8\n"; +$main->transfer ($proca); +print $/ != 55 ? "not " : "ok 5\n"; +$main->transfer ($proca); +print $/ != 55 ? "not " : "ok 7\n"; +$main->transfer ($procb); +print $/ != 55 ? "not " : "ok 9\n";