diff options
author | Jesse Luehrs <doy@tozt.net> | 2011-01-25 15:15:06 -0600 |
---|---|---|
committer | Jesse Luehrs <doy@tozt.net> | 2011-01-25 15:35:35 -0600 |
commit | a010922759e895ca9eaec3c1187910f5622ced53 (patch) | |
tree | 460bf2a52ea2d8bc6634966191aa589107816dea | |
parent | 64c74c4d2d2718a2059cc4dbc1626e4eb2b068db (diff) | |
download | circular-require-a010922759e895ca9eaec3c1187910f5622ced53.tar.gz circular-require-a010922759e895ca9eaec3c1187910f5622ced53.zip |
more tests
-rw-r--r-- | t/01-basic.t | 32 |
1 files changed, 31 insertions, 1 deletions
diff --git a/t/01-basic.t b/t/01-basic.t index 5ddde3f..a921d1e 100644 --- a/t/01-basic.t +++ b/t/01-basic.t @@ -4,7 +4,9 @@ use warnings; use lib 't/01'; use Test::More; -no circular::require; +use circular::require (); + +circular::require->unimport; { my $warnings; @@ -30,9 +32,37 @@ no circular::require; clear(); } +circular::require->import; + +{ + my $warnings; + local $SIG{__WARN__} = sub { $warnings .= $_[0] }; + use_ok('Foo'); + is($warnings, undef, "correct warnings"); + clear(); +} + +{ + my $warnings; + local $SIG{__WARN__} = sub { $warnings .= $_[0] }; + use_ok('Bar'); + is($warnings, undef, "correct warnings"); + clear(); +} + +{ + my $warnings; + local $SIG{__WARN__} = sub { $warnings .= $_[0] }; + use_ok('Baz'); + is($warnings, undef, "correct warnings"); + clear(); +} + sub clear { for (qw(Foo Bar Baz)) { + no strict 'refs'; delete $::{$_}; + delete ${$_ . '::'}{quux}; delete $INC{"$_.pm"}; } } |