X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?p=p5sagit%2FConfig-Any.git;a=blobdiff_plain;f=t%2F54-xml.t;h=0d546cb98e3d19c48f877ecb8a793af1d83f864c;hp=e2badee400cf7174eecb5cccf083c89c843dd155;hb=ca9c33fa2d09407646e2dc040b83ee4ccaac13dc;hpb=dcfb1d1d1a544d27a82cb174168df23abc539acb diff --git a/t/54-xml.t b/t/54-xml.t index e2badee..0d546cb 100644 --- a/t/54-xml.t +++ b/t/54-xml.t @@ -2,13 +2,14 @@ use strict; use warnings; use Test::More; +use Config::Any; use Config::Any::XML; if ( !Config::Any::XML->is_supported ) { plan skip_all => 'XML format not supported'; } else { - plan tests => 4; + plan tests => 8; } { @@ -30,3 +31,22 @@ SKIP: { ok( !$config, 'config load failed' ); ok( $@, "error thrown ($@)" ); } + +# test conf file with array ref +{ + my $file = 't/conf/conf_arrayref.xml'; + my $config = eval { Config::Any::XML->load( $file ) }; + + ok( $config, 'config loaded' ); + ok( !$@, 'no error thrown' ); +} + +# parse error generated on invalid config +{ + my $file = 't/invalid/conf.xml'; + my $config = eval { Config::Any->load_files( { files => [$file], use_ext => 1} ) }; + + ok( !$config, 'config load failed' ); + ok( $@, "error thrown ($@)" ); +} +