X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?p=p5sagit%2FConfig-Any.git;a=blobdiff_plain;f=t%2F52-json.t;fp=t%2F52-json.t;h=555e74e3fc1eb4e2ff27a0c5cd50439200ba5cf4;hp=65c6099a69ad6ed145a672b329003105caf814dc;hb=67a1cd509bfc3f77a4fcaf42710de01597987bb0;hpb=f9f3d682a0332cec1207764dcada85a7ff7750f0 diff --git a/t/52-json.t b/t/52-json.t index 65c6099..555e74e 100644 --- a/t/52-json.t +++ b/t/52-json.t @@ -2,13 +2,14 @@ use strict; use warnings; use Test::More; +use Config::Any; use Config::Any::JSON; if ( !Config::Any::JSON->is_supported ) { plan skip_all => 'JSON format not supported'; } else { - plan tests => 4; + plan tests => 6; } { @@ -25,3 +26,12 @@ else { ok( !$config, 'config load failed' ); ok( $@, "error thrown ($@)" ); } + +# parse error generated on invalid config +{ + my $file = 't/invalid/conf.json'; + my $config = eval { Config::Any->load_files( { files => [$file], use_ext => 1} ) }; + + ok( !$config, 'config load failed' ); + ok( $@, "error thrown ($@)" ); +}