summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJesse Luehrs <doy@tozt.net>2011-01-25 15:15:06 -0600
committerJesse Luehrs <doy@tozt.net>2011-01-25 15:35:35 -0600
commita010922759e895ca9eaec3c1187910f5622ced53 (patch)
tree460bf2a52ea2d8bc6634966191aa589107816dea
parent64c74c4d2d2718a2059cc4dbc1626e4eb2b068db (diff)
downloadcircular-require-a010922759e895ca9eaec3c1187910f5622ced53.tar.gz
circular-require-a010922759e895ca9eaec3c1187910f5622ced53.zip
more tests
-rw-r--r--t/01-basic.t32
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"};
}
}