moved tests in own directory, added test to demonstrate XML::Simple feature
[webpac] / tests / test_xml_simple.pl
diff --git a/tests/test_xml_simple.pl b/tests/test_xml_simple.pl
new file mode 100755 (executable)
index 0000000..285b73e
--- /dev/null
@@ -0,0 +1,20 @@
+#!/usr/bin/perl -w
+
+use strict;
+use XML::Simple;
+use IO::File;
+use Data::Dumper;
+
+my $xml = '<?xml version="1.0" encoding="ISO-8859-2"?><xml foo="a" foo_a=" a" foo_a_=" a " fooa_="a ">truæ</xml>';
+
+my $xml_file = shift @ARGV;
+
+if ($xml_file) {
+       my $fh = new IO::File($xml_file) || die "can't open $xml_file: $!";
+       $xml = XMLin($fh);
+} else {
+       $xml = XMLin($xml);
+}
+
+print Dumper($xml),"\n";
+