From: Arthur Axel 'fREW' Schmidt Date: Tue, 31 Aug 2010 14:12:09 +0000 (-0500) Subject: optionalize DwarnN test X-Git-Tag: v2.012^0 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?p=p5sagit%2FData-Dumper-Concise.git;a=commitdiff_plain;h=452e7ff29c95f7771bf5efd31c24cfb6f2d7b2bb optionalize DwarnN test --- diff --git a/Changes b/Changes index a24e278..7b432c7 100644 --- a/Changes +++ b/Changes @@ -1,3 +1,6 @@ +2.012 Aug 31 2010 + - Make DwarnN test still work if Devel::ArgNames isn't installed + 2.011 Aug 30 2010 - add $DwarnN export - make Devel::ArgNames an optional dep diff --git a/lib/Data/Dumper/Concise.pm b/lib/Data/Dumper/Concise.pm index 2a29056..0ec1961 100644 --- a/lib/Data/Dumper/Concise.pm +++ b/lib/Data/Dumper/Concise.pm @@ -2,7 +2,7 @@ package Data::Dumper::Concise; use 5.006; -$VERSION = '2.011'; +$VERSION = '2.012'; require Exporter; require Data::Dumper; diff --git a/t/sugar.t b/t/sugar.t index d62ed27..8c1dba0 100644 --- a/t/sugar.t +++ b/t/sugar.t @@ -46,13 +46,16 @@ DWARN_CODEREF: { } DWARNN: { - my $x = [1]; - my $foo = DwarnN $x; - is $warned_string, qq{\$x => [\n 1\n]\n}, 'DwarnN warns'; + my $loaded = eval { require Devel::ArgNames; 1 }; + if ($loaded) { + my $x = [1]; + my $foo = DwarnN $x; + is $warned_string, qq{\$x => [\n 1\n]\n}, 'DwarnN warns'; - ok eq_array($foo, [1]), 'DwarnN passes through correctly'; + ok eq_array($foo, [1]), 'DwarnN passes through correctly'; - DwarnN [1]; - is $warned_string, qq{(anon) => [\n 1\n]\n}, 'DwarnN warns'; + DwarnN [1]; + is $warned_string, qq{(anon) => [\n 1\n]\n}, 'DwarnN warns'; + } }