From: Grant M. <gr...@us...> - 2002-10-10 21:36:16
|
Update of /cvsroot/perl-xml/xml-filter-nsnormalise/t In directory usw-pr-cvs1:/tmp/cvs-serv14219/t Modified Files: 1_basic.t 2_more.t Log Message: - skip tests if SAX installation broken Index: 1_basic.t =================================================================== RCS file: /cvsroot/perl-xml/xml-filter-nsnormalise/t/1_basic.t,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -u -d -r1.1.1.1 -r1.2 --- 1_basic.t 9 Oct 2002 02:25:33 -0000 1.1.1.1 +++ 1_basic.t 10 Oct 2002 21:36:13 -0000 1.2 @@ -1,4 +1,7 @@ # $Id$ +############################################################################## +# Very basic tests that do not rely on XML::SAX being installed correctly. +# use strict; use Test::More tests => 6; Index: 2_more.t =================================================================== RCS file: /cvsroot/perl-xml/xml-filter-nsnormalise/t/2_more.t,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- 2_more.t 9 Oct 2002 23:06:08 -0000 1.2 +++ 2_more.t 10 Oct 2002 21:36:13 -0000 1.3 @@ -1,4 +1,7 @@ # $Id$ +############################################################################## +# These tests require a functional XML::SAX installation +# use strict; use Test::More; @@ -11,6 +14,18 @@ unless(eval { require XML::SAX::ParserFactory }) { plan skip_all => 'XML::SAX::ParserFactory not installed'; + } + + # Test SAX installation + + eval { + my $xml = ''; + my $writer = XML::SAX::Writer->new(Output => \$xml); + my $parser = XML::SAX::ParserFactory->parser(Handler => $writer); + $parser->parse_string('<doc>text</doc>'); + }; + if($@) { + plan skip_all => "XML::SAX is not installed correctly: $@"; } } |