[poe-commits] SF.net SVN: poe: [1944] trunk/poe
Brought to you by:
rcaputo
From: <rc...@us...> - 2006-04-29 22:37:42
|
Revision: 1944 Author: rcaputo Date: 2006-04-29 15:37:31 -0700 (Sat, 29 Apr 2006) ViewCVS: http://svn.sourceforge.net/poe/?rev=1944&view=rev Log Message: ----------- Add a test case for rt14444 based on test code by Matt Sickler. Modified Paths: -------------- trunk/poe/MANIFEST Added Paths: ----------- trunk/poe/tests/90_regression/rt14444-arg1.t Modified: trunk/poe/MANIFEST =================================================================== --- trunk/poe/MANIFEST 2006-04-29 18:13:09 UTC (rev 1943) +++ trunk/poe/MANIFEST 2006-04-29 22:37:31 UTC (rev 1944) @@ -159,6 +159,7 @@ tests/90_regression/ferrari-server-unix.t tests/90_regression/merijn-sigchld-system.t tests/90_regression/neyuki_detach.t +tests/90_regression/rt14444-arg1.t tests/90_regression/rt1648-tied-stderr.t tests/90_regression/steinert-passed-wheel.t tests/90_regression/steinert-recursive-signal.t Added: trunk/poe/tests/90_regression/rt14444-arg1.t =================================================================== --- trunk/poe/tests/90_regression/rt14444-arg1.t (rev 0) +++ trunk/poe/tests/90_regression/rt14444-arg1.t 2006-04-29 22:37:31 UTC (rev 1944) @@ -0,0 +1,46 @@ +#!/usr/bin/perl +# $Id$ +# vim: filetype=perl + +use warnings; +use strict; + +use POE; +use Test::More tests => 3; + +my $test_state = "some_random_state"; +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"); + } + + $_[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; +exit 0; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |