Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

more namespace::clean stuff

  • Loading branch information...
commit 4ccc8797d809666cf018d647ac3b6bbeb5ab4725 1 parent b1a8d47
@nothingmuch authored
Showing with 10 additions and 6 deletions.
  1. +4 −5 lib/Data/Thunk/Code.pm
  2. +6 −1 t/01-basic.t
View
9 lib/Data/Thunk/Code.pm
@@ -6,8 +6,9 @@ package Data::Thunk::Code;
use strict;
use warnings;
-use Data::Swap ();
+use Data::Swap;
use Scalar::Util qw(reftype blessed);
+use Carp;
use namespace::clean;
@@ -24,7 +25,7 @@ BEGIN {
if ( CORE::ref($tmp) ) {
my ( $ret, $e ) = do {
local $@;
- eval { Data::Swap::swap $_[0], $tmp; 1 }, $@;
+ eval { swap $_[0], $tmp; 1 }, $@;
};
unless ( $ret ) {
@@ -40,9 +41,7 @@ BEGIN {
my $file = quotemeta(__FILE__);
$e =~ s/ at $file line \d+.\n$/ $lazy_ctx, vivified/; # becomes "vivified at foo line blah"..
- warn "error";
- require Carp;
- Carp::croak($e);
+ croak($e);
}
return $_[0];
View
7 t/01-basic.t
@@ -1,4 +1,4 @@
-use Test::More tests => 35;
+use Test::More tests => 50;
use ok 'Data::Thunk';
use Scalar::Util qw(reftype);
@@ -67,3 +67,8 @@ can_ok( $obj, "flarp" );
ok( $obj->isa("Bar"), "object isa bar" );
is( $new, 1, "new called once" );
+
+foreach my $class ( qw( Data::Thunk::Code Data::Thunk::Object Data::Thunk::ScalarValue ) ) {
+ ok( !$class->can($_), "can't call export $_ as method on $class" )
+ for qw(croak carp reftype blessed swap);
+}
Please sign in to comment.
Something went wrong with that request. Please try again.