# $Id: xsl_cond.t,v 1.2 2001/01/16 03:14:14 hexmode Exp $
# check test attributes && the interface
use strict;
use vars qw( $loaded );
BEGIN { $| = 1; print "1..7\n"; }
END {print "not ok 1\n" unless $loaded;}
use XML::XSLT;
print "ok 1\n";
$loaded = 1;
my $parser = eval {
XML::XSLT->new (\<<\EOS);
o
not ok
k
EOS
};
if($@)
{
print "not ok 2 # $@\n";
exit;
}
print "ok 2\n";
if(!$parser)
{
print "not ok 3 # parser is null\n";
exit;
}
print "ok 3\n";
eval {
$parser->transform(\<<\EOX);
foosome random text
EOX
};
if($@)
{
print "not ok 4 # $@\n";
exit();
}
print "ok 4\n";
my $outstr= eval { $parser->toString };
if($@)
{
print "not ok 5 # $@\n";
exit;
}
print "ok 5\n";
print 'not ' unless defined $outstr;
print "ok 6\n";
my $correct='ok';
print 'not ' unless(defined($outstr) and $outstr eq $correct);
print "ok 7\n";