Update of /cvsroot/poe/poe/tests/20_resources/00_base
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv16995/tests/20_resources/00_base
Modified Files:
caller_state.pm
Log Message:
Remove tabs from source code. People (myself included) have been
introducing them with edits and patches.
Index: caller_state.pm
===================================================================
RCS file: /cvsroot/poe/poe/tests/20_resources/00_base/caller_state.pm,v
retrieving revision 1.1
retrieving revision 1.2
diff -C2 -d -r1.1 -r1.2
*** caller_state.pm 16 Nov 2004 08:25:54 -0000 1.1
--- caller_state.pm 22 Apr 2005 20:36:32 -0000 1.2
***************
*** 18,83 ****
inline_states => {
_start => sub {
! $_[KERNEL]->post($_[SESSION],'check_1');
! # set our callback and postback
! $_[HEAP]->{postback} = $_[SESSION]->postback("check_4");
! $_[HEAP]->{callback} = $_[SESSION]->callback("check_5");
},
check_1 => sub {
! if ($_[CALLER_STATE] eq '_start') {
! pass("called from _start"); # 2
! } else {
! diag("post failed: caller state is $_[CALLER_STATE] (should be _start)");
! fail("called from _start");
! delete $_[HEAP]->{callback};
! delete $_[HEAP]->{postback};
! return;
! }
! $_[KERNEL]->yield("check_2");
},
! check_2 => sub {
! if ($_[CALLER_STATE] eq 'check_1') {
! pass("called from check_1"); # 3
! } else {
! diag("yield failed: caller state is $_[CALLER_STATE] (should be check_1)");
! fail("called from check_1");
! delete $_[HEAP]->{callback};
! delete $_[HEAP]->{postback};
! return;
! }
! # since we are calling check_3, and the postback calls check_4
! # the callback there will see it as if this session called it
! $_[KERNEL]->call($_[SESSION], "check_3");
! },
! check_3 => sub {
! if ($_[CALLER_STATE] eq 'check_2') {
! pass("called from check_2"); # 4
! } else {
! diag("call failed: caller state is $_[CALLER_STATE] (should be check_2)");
! fail("called from check_2");
! return;
! }
! my $postback = delete $_[HEAP]->{postback};
! $postback->();
! },
! check_4 => sub {
! # this _should_ look like it comes from check_2 because of the call()
! if ($_[CALLER_STATE] eq 'check_2') {
! pass("called from check_2 (again)"); # 5
! } else {
! diag("postback failed: caller state is $_[CALLER_STATE] (should be check_2)");
! fail("called from check_2");
! }
! my $callback = delete $_[HEAP]->{callback};
! $callback->();
! },
! check_5 => sub {
! if ($_[CALLER_STATE] eq 'check_4') {
! pass("called from check_4"); # 6
! } else {
! diag("callback failed: caller state is $_[CALLER_STATE] (should be check_4)");
! fail("called from check_4");
! }
! },
! _stop => sub { }
}
);
--- 18,83 ----
inline_states => {
_start => sub {
! $_[KERNEL]->post($_[SESSION],'check_1');
! # set our callback and postback
! $_[HEAP]->{postback} = $_[SESSION]->postback("check_4");
! $_[HEAP]->{callback} = $_[SESSION]->callback("check_5");
},
check_1 => sub {
! if ($_[CALLER_STATE] eq '_start') {
! pass("called from _start"); # 2
! } else {
! diag("post failed: caller state is $_[CALLER_STATE] (should be _start)");
! fail("called from _start");
! delete $_[HEAP]->{callback};
! delete $_[HEAP]->{postback};
! return;
! }
! $_[KERNEL]->yield("check_2");
},
! check_2 => sub {
! if ($_[CALLER_STATE] eq 'check_1') {
! pass("called from check_1"); # 3
! } else {
! diag("yield failed: caller state is $_[CALLER_STATE] (should be check_1)");
! fail("called from check_1");
! delete $_[HEAP]->{callback};
! delete $_[HEAP]->{postback};
! return;
! }
! # since we are calling check_3, and the postback calls check_4
! # the callback there will see it as if this session called it
! $_[KERNEL]->call($_[SESSION], "check_3");
! },
! check_3 => sub {
! if ($_[CALLER_STATE] eq 'check_2') {
! pass("called from check_2"); # 4
! } else {
! diag("call failed: caller state is $_[CALLER_STATE] (should be check_2)");
! fail("called from check_2");
! return;
! }
! my $postback = delete $_[HEAP]->{postback};
! $postback->();
! },
! check_4 => sub {
! # this _should_ look like it comes from check_2 because of the call()
! if ($_[CALLER_STATE] eq 'check_2') {
! pass("called from check_2 (again)"); # 5
! } else {
! diag("postback failed: caller state is $_[CALLER_STATE] (should be check_2)");
! fail("called from check_2");
! }
! my $callback = delete $_[HEAP]->{callback};
! $callback->();
! },
! check_5 => sub {
! if ($_[CALLER_STATE] eq 'check_4') {
! pass("called from check_4"); # 6
! } else {
! diag("callback failed: caller state is $_[CALLER_STATE] (should be check_4)");
! fail("called from check_4");
! }
! },
! _stop => sub { }
}
);
|