use strict; use warnings; use Test; use XML::Dumper; BEGIN { plan tests => 3 } sub check( $$ ); check "correct handling of undef()", < Foo Bar XML check "undef() for arrays", < Foo Bar XML check "undef() for hashes", < Foo Bar XML # ============================================================ sub check( $$ ) { # ============================================================ # Bug submitted 11/26/02 by Peter S. May # ------------------------------------------------------------ my $test = shift; my $xml = shift; my $perl = xml2pl( $xml ); my $roundtrip_xml = pl2xml( $perl ); if( xml_compare( $xml, $roundtrip_xml )) { ok( 1 ); return; } print STDERR "\nTest for $test failed: data doesn't match!\n\n" . "Got:\n----\n'$xml'\n----\n". "Came up with:\n----\n'$roundtrip_xml'\n----\n"; ok( 0 ); }