Update of /cvsroot/perl-xml/xml-simple/t
In directory sc8-pr-cvs1:/tmp/cvs-serv13035/t
Modified Files:
2_XMLout.t
Log Message:
- adjusted uninitialised value warning test to enable warnings first
- added test for NoIndent option
Index: 2_XMLout.t
===================================================================
RCS file: /cvsroot/perl-xml/xml-simple/t/2_XMLout.t,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -d -r1.6 -r1.7
--- 2_XMLout.t 10 Apr 2003 10:20:07 -0000 1.6
+++ 2_XMLout.t 16 Apr 2003 10:19:24 -0000 1.7
@@ -5,7 +5,7 @@
use Test::More;
use IO::File;
-plan tests => 190;
+plan tests => 192;
##############################################################################
# S U P P O R T R O U T I N E S
@@ -628,6 +628,7 @@
# Check undefined values generate warnings
{
+ $^W = 1;
my $warn = '';
local $SIG{__WARN__} = sub { $warn = $_[0] };
$_ = eval {
@@ -878,6 +879,24 @@
</dirs>\s*
</\1>$
}x, 'Failed to unwrap/group stripped content - as expected');
+
+
+# Check 'NoIndent' option
+
+$ref = {
+ nest => [ qw(one two three) ]
+};
+
+# Expect:
+#
+# <opt><nest>one</nest><nest>two</nest><nest>three</nest></opt>
+#
+
+$_ = XMLout($ref, NoIndent => 1);
+
+is_deeply(XMLin($_), $ref, 'parses ok');
+is($_, '<opt><nest>one</nest><nest>two</nest><nest>three</nest></opt>',
+'NoIndent worked ok');
# 'Stress test' with a data structure that maps to several thousand elements.
|