[poe-commits] SF.net SVN: poe: [2058] trunk/poe/tests/90_regression
Brought to you by:
rcaputo
From: <rc...@us...> - 2006-08-21 06:26:01
|
Revision: 2058 Author: rcaputo Date: 2006-08-20 23:25:50 -0700 (Sun, 20 Aug 2006) ViewCVS: http://svn.sourceforge.net/poe/?rev=2058&view=rev Log Message: ----------- Tabs to spaces. Bleah. Modified Paths: -------------- trunk/poe/tests/10_units/07_exceptions/02_turn_off.t trunk/poe/tests/10_units/07_exceptions/03_not_handled.t trunk/poe/tests/30_loops/00_base/sbk_signal_init.pm trunk/poe/tests/90_regression/rt14444-arg1.t trunk/poe/tests/90_regression/steinert-recursive-signal.t Modified: trunk/poe/tests/10_units/07_exceptions/02_turn_off.t =================================================================== --- trunk/poe/tests/10_units/07_exceptions/02_turn_off.t 2006-08-20 21:06:21 UTC (rev 2057) +++ trunk/poe/tests/10_units/07_exceptions/02_turn_off.t 2006-08-21 06:25:50 UTC (rev 2058) @@ -6,24 +6,21 @@ use POE; eval { - POE::Session->create( - inline_states => { - _start => sub { - pass("Session started"); - $_[KERNEL]->yield('death'); - }, + POE::Session->create( + inline_states => { + _start => sub { + pass("Session started"); + $_[KERNEL]->yield('death'); + }, - _stop => sub { pass("Session stopping"); }, + _stop => sub { pass("Session stopping"); }, - death => sub { die "OMG THEY CANCELLED FRIENDS"; }, - }, - ); + death => sub { die "OMG THEY CANCELLED FRIENDS"; }, + }, + ); - POE::Kernel->run(); + POE::Kernel->run(); }; ok(length $@, "die caused normal exception"); like($@, qr/OMG THEY CANCELLED FRIENDS/, '$@ contains correct error message'); - - -# sungo // vim: ts=4 sw=4 noexpandtab Modified: trunk/poe/tests/10_units/07_exceptions/03_not_handled.t =================================================================== --- trunk/poe/tests/10_units/07_exceptions/03_not_handled.t 2006-08-20 21:06:21 UTC (rev 2057) +++ trunk/poe/tests/10_units/07_exceptions/03_not_handled.t 2006-08-21 06:25:50 UTC (rev 2058) @@ -5,40 +5,37 @@ use POE; POE::Session->create( - inline_states => { - _start => sub { - pass("Session started"); - $_[KERNEL]->sig('DIE' => 'mock_death'); - $_[KERNEL]->yield('death'); - }, + inline_states => { + _start => sub { + pass("Session started"); + $_[KERNEL]->sig('DIE' => 'mock_death'); + $_[KERNEL]->yield('death'); + }, - _stop => sub { pass("Session stopping"); }, + _stop => sub { pass("Session stopping"); }, - death => sub { die "OMG THEY CANCELLED FRIENDS"; }, - mock_death => sub { is($_[ARG0], 'DIE', "DIE signal sent"); }, - }, + death => sub { die "OMG THEY CANCELLED FRIENDS"; }, + mock_death => sub { is($_[ARG0], 'DIE', "DIE signal sent"); }, + }, ); POE::Session->create( - inline_states => { - _start => sub { - pass("Other session started"); - $_[KERNEL]->delay('last_breath' => 0.5); - }, + inline_states => { + _start => sub { + pass("Other session started"); + $_[KERNEL]->delay('last_breath' => 0.5); + }, - _stop => sub { pass("Other session stopping"); }, - - last_breath => sub { fail("POE environment survived uncaught exception"); }, - }, + _stop => sub { pass("Other session stopping"); }, + + last_breath => sub { fail("POE environment survived uncaught exception"); }, + }, ); eval { - POE::Kernel->run(); + POE::Kernel->run(); }; ok(length $@, "unhandled exception was propagated"); like($@, qr/OMG THEY CANCELLED FRIENDS/, '$@contains the correct error message'); pass("POE environment shut down"); - - -# sungo // vim: ts=4 sw=4 noexpandtab Modified: trunk/poe/tests/30_loops/00_base/sbk_signal_init.pm =================================================================== --- trunk/poe/tests/30_loops/00_base/sbk_signal_init.pm 2006-08-20 21:06:21 UTC (rev 2057) +++ trunk/poe/tests/30_loops/00_base/sbk_signal_init.pm 2006-08-21 06:25:50 UTC (rev 2058) @@ -11,7 +11,7 @@ use Test::More tests => 1; BEGIN { - $SIG{ALRM} = \&dispatch_normal_signal; + $SIG{ALRM} = \&dispatch_normal_signal; } my $signal_dispatched = 0; Modified: trunk/poe/tests/90_regression/rt14444-arg1.t =================================================================== --- trunk/poe/tests/90_regression/rt14444-arg1.t 2006-08-20 21:06:21 UTC (rev 2057) +++ trunk/poe/tests/90_regression/rt14444-arg1.t 2006-08-21 06:25:50 UTC (rev 2058) @@ -12,34 +12,34 @@ my @test_args = qw(some random args); POE::Session->create( - inline_states => { - _start => sub { - $_[KERNEL]->yield($test_state, @test_args); - }, - _default => sub { - my ($orig_state, $orig_args) = @_[ARG0,ARG1]; - if ($orig_state eq $test_state) { - is_deeply(\@test_args, $orig_args, "test args passed okay"); - } + inline_states => { + _start => sub { + $_[KERNEL]->yield($test_state, @test_args); + }, + _default => sub { + my ($orig_state, $orig_args) = @_[ARG0,ARG1]; + if ($orig_state eq $test_state) { + is_deeply(\@test_args, $orig_args, "test args passed okay"); + } - $_[KERNEL]->yield( check_ref => $_[ARG1] ); - $_[KERNEL]->yield( check_copy => [@{$_[ARG1]}] ); - }, - check_ref => sub { - my $test_args = $_[ARG0]; - is_deeply( - \@test_args, $test_args, - "args preserved in pass by reference", - ); - }, - check_copy => sub { - my $test_args = $_[ARG0]; - is_deeply( - \@test_args, $test_args, - "args preserved in pass by copy", - ); - } - } + $_[KERNEL]->yield( check_ref => $_[ARG1] ); + $_[KERNEL]->yield( check_copy => [@{$_[ARG1]}] ); + }, + check_ref => sub { + my $test_args = $_[ARG0]; + is_deeply( + \@test_args, $test_args, + "args preserved in pass by reference", + ); + }, + check_copy => sub { + my $test_args = $_[ARG0]; + is_deeply( + \@test_args, $test_args, + "args preserved in pass by copy", + ); + } + } ); POE::Kernel->run; Modified: trunk/poe/tests/90_regression/steinert-recursive-signal.t =================================================================== --- trunk/poe/tests/90_regression/steinert-recursive-signal.t 2006-08-20 21:06:21 UTC (rev 2057) +++ trunk/poe/tests/90_regression/steinert-recursive-signal.t 2006-08-21 06:25:50 UTC (rev 2058) @@ -21,30 +21,30 @@ my $i = 0; POE::Session->create( - inline_states => { - _start => sub { - ok( ++$i == 1, "Session startup" ); - $_[KERNEL]->sig( 'HUP', 'hup' ); - $_[KERNEL]->sig( 'DIE', 'death' ); - $_[KERNEL]->signal( $_[SESSION], 'HUP' ); - $_[KERNEL]->yield( 'bad' ); - }, - bad => sub { - fail( "We shouldn't get here" ); - }, - hup => sub { - ok( ++$i == 2, "HUP handler" ); - my $foo = undef; - $foo->put(); # oh my! - }, - death => sub { - ok( ++$i == 3, "DIE handler" ); - $_[KERNEL]->sig_handled(); - }, - _stop => sub { - ok( ++$i == 4, "Session shutdown" ); - }, - }, + inline_states => { + _start => sub { + ok( ++$i == 1, "Session startup" ); + $_[KERNEL]->sig( 'HUP', 'hup' ); + $_[KERNEL]->sig( 'DIE', 'death' ); + $_[KERNEL]->signal( $_[SESSION], 'HUP' ); + $_[KERNEL]->yield( 'bad' ); + }, + bad => sub { + fail( "We shouldn't get here" ); + }, + hup => sub { + ok( ++$i == 2, "HUP handler" ); + my $foo = undef; + $foo->put(); # oh my! + }, + death => sub { + ok( ++$i == 3, "DIE handler" ); + $_[KERNEL]->sig_handled(); + }, + _stop => sub { + ok( ++$i == 4, "Session shutdown" ); + }, + }, ); # The following session checks to make sure that a nonmaskable signal is @@ -53,31 +53,31 @@ my $j = 0; POE::Session->create( - inline_states => { - _start => sub { - ok( ++$j == 1, "Second session startup" ); - $_[KERNEL]->sig( 'ZOMBIE', 'zombie' ); - $_[KERNEL]->sig( 'DIE', 'death' ); - $_[KERNEL]->signal( $_[SESSION], 'ZOMBIE' ); - $_[KERNEL]->yield( 'bad' ); - }, - bad => sub { - fail( "We shouldn't get here" ); - }, - zombie => sub { - ok( ++$j == 2, "Zombie handler" ); - $_[KERNEL]->sig_handled(); # handling this should still die - my $foo = undef; - $foo->put(); # oh my! - }, - death => sub { - ok( ++$j == 3, "DIE handler" ); - $_[KERNEL]->sig_handled(); - }, - _stop => sub { - ok( ++$j == 4, "Second session shutdown" ); - }, - }, + inline_states => { + _start => sub { + ok( ++$j == 1, "Second session startup" ); + $_[KERNEL]->sig( 'ZOMBIE', 'zombie' ); + $_[KERNEL]->sig( 'DIE', 'death' ); + $_[KERNEL]->signal( $_[SESSION], 'ZOMBIE' ); + $_[KERNEL]->yield( 'bad' ); + }, + bad => sub { + fail( "We shouldn't get here" ); + }, + zombie => sub { + ok( ++$j == 2, "Zombie handler" ); + $_[KERNEL]->sig_handled(); # handling this should still die + my $foo = undef; + $foo->put(); # oh my! + }, + death => sub { + ok( ++$j == 3, "DIE handler" ); + $_[KERNEL]->sig_handled(); + }, + _stop => sub { + ok( ++$j == 4, "Second session shutdown" ); + }, + }, ); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |