You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@xerces.apache.org by ja...@apache.org on 2001/06/14 07:24:42 UTC
cvs commit: xml-xerces/perl/t SAX2Count.t
jasons 01/06/13 22:24:42
Added: perl/t SAX2Count.t
Log:
* t/SAX2Count.t (Message):
test for SAX2Count.pl
Revision Changes Path
1.1 xml-xerces/perl/t/SAX2Count.t
Index: SAX2Count.t
===================================================================
# Before `make install' is performed this script should be runnable
# with `make test'. After `make install' it should work as `perl
# SAX2Count.t
######################### We start with some black magic to print on failure.
# Change 1..1 below to 1..last_test_to_print .
# (It may become useful if the test is moved to ./t subdirectory.)
BEGIN { $| = 1; print "1..5\n"; }
END {print "not ok 1\n" unless $loaded;}
use Carp;
# use blib;
use XML::Xerces;
use Config;
use lib 't';
use TestUtils qw(result);
use vars qw($i $loaded $file);
use strict;
$loaded = 1;
$i = 1;
result($loaded);
######################### End of black magic.
# Insert your test code below (better if it prints "ok 13"
# (correspondingly "not ok 13") depending on the success of chunk 13
# of the test code):
my $document = q[<?xml version="1.0" encoding="utf-8"?>
<contributors>
<person Role="manager">
<name>Mike Pogue</name>
<email>mpogue@us.ibm.com</email>
</person>
<person Role="developer">
<name>Tom Watson</name>
<email>rtwatson@us.ibm.com</email>
</person>
<person Role="tech writer">
<name>Susan Hardenbrook</name>
<email>susanhar@us.ibm.com</email>
</person>
</contributors>];
$file = '.domprint.xml';
open(OUT,">$file") or die "Couldn't open $file from writing";
print OUT $document;
my @output = split(/\n/,`$Config{perlpath} -Mblib ./samples/SAX2Count.pl $file`);
$output[1] =~ /\s(\d+)/;
result($1 == 10);
$output[2] =~ /\b(\d+)\b/;
result($1 == 0);
$output[3] =~ /\b(\d+)\b/;
result($1 == 0);
$output[4] =~ /\b(\d+)\b/;
result($1 == 123);
END {unlink $file;}
---------------------------------------------------------------------
To unsubscribe, e-mail: xerces-cvs-unsubscribe@xml.apache.org
For additional commands, e-mail: xerces-cvs-help@xml.apache.org