X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?p=p5sagit%2FConfig-Any.git;a=blobdiff_plain;f=t%2F51-ini.t;h=5cee996ca5642bf6c3ac5b08b4d32f4093c68045;hp=8040d5b91b7b5e52fe56f0a15690667302098211;hb=c2a19f634f7a084c1e9c76142d4e7554895d454b;hpb=5a2e0210fe5c7da046be37b4240008f2b667be67 diff --git a/t/51-ini.t b/t/51-ini.t index 8040d5b..5cee996 100644 --- a/t/51-ini.t +++ b/t/51-ini.t @@ -2,13 +2,14 @@ use strict; use warnings; use Test::More; +use Config::Any; use Config::Any::INI; -if ( !Config::Any::INI->is_supported ) { +if ( !Config::Any::INI->is_supported && !$ENV{RELEASE_TESTING} ) { plan skip_all => 'INI format not supported'; } else { - plan tests => 11; + plan tests => 15; } { @@ -46,3 +47,21 @@ else { ok( $config, 'config loaded' ); is_deeply( $config, \%expected, 'subsections parsed properly' ); } + +# test invalid config +{ + my $file = 't/invalid/conf.ini'; + my $config = eval { Config::Any::INI->load( $file ) }; + + is $config, undef, 'config load failed'; + isnt $@, '', 'error thrown'; +} + +# parse error generated on invalid config +{ + my $file = 't/invalid/conf.ini'; + my $config = eval { Config::Any->load_files( { files => [$file], use_ext => 1} ) }; + + is $config, undef, 'config load failed'; + isnt $@, '', 'error thrown'; +}