make Data::Dump optional
authorDobrica Pavlinusic <dpavlin@rot13.org>
Thu, 21 Jun 2007 10:23:12 +0000 (10:23 +0000)
committerDobrica Pavlinusic <dpavlin@rot13.org>
Thu, 21 Jun 2007 10:23:12 +0000 (10:23 +0000)
git-svn-id: svn+ssh://llin/home/dpavlin/private/svn/MARC-Fast/trunk@16 49f9634a-d7ec-0310-8e6b-ec35c6cc8804

t/001_marc.t

index 02d75af..3553dc3 100755 (executable)
@@ -5,11 +5,16 @@ use blib;
 
 use Test::More tests => 40;
 use Test::Exception;
-use Data::Dump qw/dump/;
 
-BEGIN { use_ok( 'MARC::Fast' ); }
+BEGIN {
+       use_ok( 'MARC::Fast' );
+}
 
 my $debug = shift @ARGV;
+if ( $debug ) {
+       eval { require Data::Dump; };
+       $debug = 0 if ($@);
+}
 
 my $marc;
 my %param;
@@ -42,7 +47,7 @@ SKIP: {
                ok($marc->fetch($_), "fetch $_");
 
                ok(my $hash = $marc->to_hash($_), "to_hash $_");
-               diag "to_hash($_) = ",dump($hash) if ($debug);
+               diag "to_hash($_) = ",Data::Dump::dump($hash) if ($debug);
                ok(my $ascii = $marc->to_ascii($_), "to_ascii $_");
                diag "to_ascii($_) ::\n$ascii" if ($debug);
        }