Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added a lot of loop-loading tests, so we can start work on the "naive…
…" loop load hacks
- Loading branch information
Larwan Berke
committed
Mar 3, 2010
1 parent
3c01254
commit d146b2f
Showing
13 changed files
with
193 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
#!/usr/bin/perl -w | ||
# vim: ts=2 sw=2 filetype=perl expandtab | ||
|
||
use strict; | ||
|
||
use Test::More tests => 2; | ||
sub POE::Kernel::ASSERT_DEFAULT () { 1 } | ||
|
||
BEGIN { | ||
package POE::Kernel; | ||
use constant TRACE_DEFAULT => exists($INC{'Devel/Cover.pm'}); | ||
} | ||
|
||
BEGIN { use_ok("POE", "Loop::IO_Poll") } | ||
|
||
is( $poe_kernel->poe_kernel_loop(), 'POE::Loop::IO_Poll', "POE loaded the right loop" ); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
#!/usr/bin/perl -w | ||
# vim: ts=2 sw=2 filetype=perl expandtab | ||
|
||
use strict; | ||
|
||
use Test::More tests => 2; | ||
sub POE::Kernel::ASSERT_DEFAULT () { 1 } | ||
|
||
BEGIN { | ||
package POE::Kernel; | ||
use constant TRACE_DEFAULT => exists($INC{'Devel/Cover.pm'}); | ||
} | ||
|
||
BEGIN { $ENV{POE_EVENT_LOOP} = "POE::Loop::IO_Poll" } | ||
|
||
BEGIN { use_ok("POE") } | ||
|
||
is( $poe_kernel->poe_kernel_loop(), 'POE::Loop::IO_Poll', "POE loaded the right loop" ); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
#!/usr/bin/perl -w | ||
# vim: ts=2 sw=2 filetype=perl expandtab | ||
|
||
use strict; | ||
|
||
use Test::More tests => 2; | ||
sub POE::Kernel::ASSERT_DEFAULT () { 1 } | ||
|
||
BEGIN { | ||
package POE::Kernel; | ||
use constant TRACE_DEFAULT => exists($INC{'Devel/Cover.pm'}); | ||
} | ||
|
||
BEGIN { use_ok("POE::Kernel") } | ||
|
||
is( $poe_kernel->poe_kernel_loop(), 'POE::Loop::Select', "POE loaded the default loop" ); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
#!/usr/bin/perl -w | ||
# vim: ts=2 sw=2 filetype=perl expandtab | ||
|
||
use strict; | ||
|
||
use Test::More tests => 2; | ||
sub POE::Kernel::ASSERT_DEFAULT () { 1 } | ||
|
||
BEGIN { | ||
package POE::Kernel; | ||
use constant TRACE_DEFAULT => exists($INC{'Devel/Cover.pm'}); | ||
} | ||
|
||
BEGIN { use_ok("POE::Kernel", { loop => 'IO_Poll' } ) } | ||
|
||
is( $poe_kernel->poe_kernel_loop(), 'POE::Loop::IO_Poll', "POE loaded the right loop" ); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
#!/usr/bin/perl -w | ||
# vim: ts=2 sw=2 filetype=perl expandtab | ||
|
||
use strict; | ||
|
||
use Test::More tests => 1; | ||
sub POE::Kernel::ASSERT_DEFAULT () { 1 } | ||
|
||
BEGIN { | ||
package POE::Kernel; | ||
use constant TRACE_DEFAULT => exists($INC{'Devel/Cover.pm'}); | ||
} | ||
|
||
# Hide warnings. | ||
{ | ||
local $SIG{__WARN__} = sub { undef }; | ||
eval "use POE::Kernel { loop => 'NightMooseDontExist' }"; | ||
} | ||
ok($@, "loading a nonexistent loop throws an error"); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
#!/usr/bin/perl -w | ||
# vim: ts=2 sw=2 filetype=perl expandtab | ||
|
||
use strict; | ||
|
||
use Test::More tests => 3; | ||
sub POE::Kernel::ASSERT_DEFAULT () { 1 } | ||
|
||
BEGIN { | ||
package POE::Kernel; | ||
use constant TRACE_DEFAULT => exists($INC{'Devel/Cover.pm'}); | ||
} | ||
|
||
BEGIN { use_ok("IO::Poll") } | ||
|
||
BEGIN { use_ok("POE") } | ||
|
||
is( $poe_kernel->poe_kernel_loop(), 'POE::Loop::IO_Poll', "POE found the right loop" ); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
#!/usr/bin/perl -w | ||
# vim: ts=2 sw=2 filetype=perl expandtab | ||
|
||
use strict; | ||
|
||
use Test::More tests => 2; | ||
sub POE::Kernel::ASSERT_DEFAULT () { 1 } | ||
|
||
BEGIN { | ||
package POE::Kernel; | ||
use constant TRACE_DEFAULT => exists($INC{'Devel/Cover.pm'}); | ||
} | ||
|
||
TODO: { | ||
local $TODO = 'This feature is not implemented yet'; | ||
|
||
# Hide warnings. | ||
{ | ||
local $SIG{__WARN__} = sub { undef }; | ||
eval "use POE::Loop::Select; use POE"; | ||
} | ||
|
||
ok(! $@, "Loading a loop the naive way doesn't explode"); | ||
|
||
# Hide warnings. | ||
my $loop_loaded; | ||
{ | ||
local $SIG{__WARN__} = sub { undef }; | ||
eval '$loop_loaded = $poe_kernel->poe_kernel_loop()'; | ||
} | ||
|
||
if ( ! $@ ) { | ||
is( $loop_loaded, 'POE::Loop::Select', "POE loaded the right loop" ); | ||
} else { | ||
ok( 0, "Dummy test for TODO" ); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
#!/usr/bin/perl -w | ||
# vim: ts=2 sw=2 filetype=perl expandtab | ||
|
||
use strict; | ||
|
||
use Test::More tests => 2; | ||
sub POE::Kernel::ASSERT_DEFAULT () { 1 } | ||
|
||
BEGIN { | ||
package POE::Kernel; | ||
use constant TRACE_DEFAULT => exists($INC{'Devel/Cover.pm'}); | ||
} | ||
|
||
TODO: { | ||
local $TODO = 'This feature is not implemented yet'; | ||
|
||
# Hide warnings. | ||
{ | ||
local $SIG{__WARN__} = sub { undef }; | ||
eval "use POE::Loop::IO_Poll; use POE"; | ||
} | ||
|
||
ok(! $@, "Loading a loop the naive way doesn't explode"); | ||
|
||
# Hide warnings. | ||
my $loop_loaded; | ||
{ | ||
local $SIG{__WARN__} = sub { undef }; | ||
eval '$loop_loaded = $poe_kernel->poe_kernel_loop()'; | ||
} | ||
|
||
if ( ! $@ ) { | ||
is( $loop_loaded, 'POE::Loop::IO_Poll', "POE loaded the right loop" ); | ||
} else { | ||
ok( 0, "Dummy test for TODO" ); | ||
} | ||
} |