From a010922759e895ca9eaec3c1187910f5622ced53 Mon Sep 17 00:00:00 2001 From: Jesse Luehrs Date: Tue, 25 Jan 2011 15:15:06 -0600 Subject: more tests --- t/01-basic.t | 32 +++++++++++++++++++++++++++++++- 1 file changed, 31 insertions(+), 1 deletion(-) 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"}; } } -- cgit v1.2.3-54-g00ecf