Subject: | Typo in test |
t/autouse.t has
ok( $@, qr/^autouse into different package attempted/ );
when it likely means
like( $@, qr/^autouse into different package attempted/ );
The attached patch fixes that and also has better and more direct
checking of the evals.
Subject: | test.patch |
diff --git a/t/autouse.t b/t/autouse.t
index 53e1740..52561f6 100644
--- a/t/autouse.t
+++ b/t/autouse.t
@@ -8,19 +8,21 @@ BEGIN {
}
}
-use Test::More tests => 12;
+use Test::More tests => 14;
BEGIN {
require autouse;
- eval {
+ ok eval {
"autouse"->import('List::Util' => 'List::Util::first(&@)');
+ 1;
};
- ok( !$@ );
+ is( $@, "" );
- eval {
+ ok !eval {
"autouse"->import('List::Util' => 'Foo::min');
+ 1;
};
- ok( $@, qr/^autouse into different package attempted/ );
+ like( $@, qr/^autouse into different package attempted/ );
"autouse"->import('List::Util' => qw(max first(&@)));
}