From: Grant M. <gr...@us...> - 2006-09-19 09:52:38
|
Update of /cvsroot/perl-xml/xml-simple/t In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv10760/t Modified Files: 2_XMLout.t Log Message: - automatically load IO::Handle if required to parse from lexical filehandle Index: 2_XMLout.t =================================================================== RCS file: /cvsroot/perl-xml/xml-simple/t/2_XMLout.t,v retrieving revision 1.15 retrieving revision 1.16 diff -u -d -r1.15 -r1.16 --- 2_XMLout.t 19 Sep 2006 08:33:30 -0000 1.15 +++ 2_XMLout.t 19 Sep 2006 09:52:34 -0000 1.16 @@ -3,7 +3,6 @@ use strict; use Test::More; -use IO::File; $^W = 1; @@ -352,10 +351,10 @@ }xs, 'and encodes as expected'); -# Try encoding a blessed reference and confirm that it fails +# Try encoding a non array/hash blessed reference and confirm that it fails -$_ = eval { my $ref = new IO::File; XMLout($ref) }; -ok(!defined($_), 'caught blessed reference in data structure'); +$_ = eval { my $ref = bless \*STDERR, 'BogoClass'; XMLout($ref) }; +is($_, undef, 'caught blessed non array/hash reference in data structure'); like($@, qr/Can't encode a value of type: /, 'with correct error message'); @@ -531,8 +530,7 @@ ok(!-e $TestFile); eval { - my $fh = new IO::File; - $fh->open(">$TestFile") || die "$!"; + open my $fh, '>', $TestFile or die "$!"; XMLout($hashref1, outputfile => $fh); $fh->close(); }; |