From 72180e43389d258d63ded73b8096a4fa1c0fb6bc Mon Sep 17 00:00:00 2001 From: Jason Edward Stewart <jasons@apache.org> Date: Mon, 28 Aug 2006 11:21:24 +0000 Subject: [PATCH] added extra stringification tests git-svn-id: https://svn.apache.org/repos/asf/xerces/c/trunk@437664 13f79535-47bb-0310-9956-ffa450edef68 --- swig/perl/t/XMLUni.t | 34 ++++++++++++++++------------------ 1 file changed, 16 insertions(+), 18 deletions(-) diff --git a/swig/perl/t/XMLUni.t b/swig/perl/t/XMLUni.t index a8f32f054..bc933f7fa 100644 --- a/swig/perl/t/XMLUni.t +++ b/swig/perl/t/XMLUni.t @@ -1,33 +1,31 @@ # Before `make install' is performed this script should be runnable # with `make test'. After `make install' it should work as `perl # XMLUni.t' +######################################### -######################### We start with some black magic to print on failure. +# use blib; +use Test::More tests => 5; +BEGIN {use_ok("XML::Xerces")}; -END {ok(0) unless $loaded;} - -use Carp; - -use blib; -use XML::Xerces; -use Test::More tests => 4; - -use vars qw($loaded); use strict; -$loaded = 1; -ok($loaded, "module loaded"); - -######################### End of black magic. - # once the unicode constants were not being properly exported # these tests guard against that happening again -ok($XML::Xerces::XMLUni::fgPCDATAString eq '#PCDATA'); -ok($XML::Xerces::XMLUni::fgPubIDString eq 'PUBLIC'); +is($XML::Xerces::XMLUni::fgPCDATAString, '#PCDATA', 'XMLUni constants exported'); +is($XML::Xerces::XMLUni::fgPubIDString, 'PUBLIC', 'XMLUni constants exported'); + +eval { + my $parser = XML::Xerces::XMLReaderFactory::createXMLReader(); + $parser->setFeature($XML::Xerces::XMLUni::fgSAX2CoreNameSpaces, 1) +}; +ok(!$@, + "Xerces method arguments now handle magic stringify - SAX2") + or diag(XML::Xerces::error($@)); my $impl = XML::Xerces::DOMImplementationRegistry::getDOMImplementation('LS'); my $writer = $impl->createLSSerializer(); eval{$writer->getDomConfig()->setParameter($XML::Xerces::XMLUni::fgDOMWRTFormatPrettyPrint,1)}; + ok(!$@, - "Xerces method arguments now handle magic stringify") + "Xerces method arguments now handle magic stringify - DOM") or diag(XML::Xerces::error($@)); -- GitLab