# $Id: xsl_cond.t,v 1.3 2001/12/17 11:32:09 gellyfish Exp $
# check test attributes && the interface
use Test::More tests => 25;
use strict;
use vars qw($DEBUGGING);
$DEBUGGING = 0;
use_ok('XML::XSLT');
# element tests
eval
{
my $parser = XML::XSLT->new (< $DEBUGGING);
o
not ok
k
EOS
$parser->transform(\<foosome random text
EOX
my $outstr = $parser->toString();
warn $outstr if $DEBUGGING;
my $correct = 'ok';
$parser->dispose();
die "$outstr ne $correct\n" unless $outstr eq $correct;
};
warn $@ if $DEBUGGING;
ok(!$@,"text node string eq");
eval
{
my $parser = XML::XSLT->new (< $DEBUGGING);
o
not ok
k
EOS
$parser->transform(\<barsome random text
EOX
my $outstr = $parser->toString();
warn $outstr if $DEBUGGING;
my $correct = 'ok';
$parser->dispose();
die "$outstr ne $correct\n" unless $outstr eq $correct;
};
ok(!$@,"text node string ne");
eval
{
my $parser = XML::XSLT->new (< $DEBUGGING);
o
not ok
k
EOS
$parser->transform(\<asome random text
EOX
my $outstr = $parser->toString();
warn $outstr if $DEBUGGING;
my $correct = 'ok';
$parser->dispose();
die "$outstr ne $correct\n" unless $outstr eq $correct;
};
warn $@ if $DEBUGGING;
ok(!$@,"text node string lt");
eval
{
my $parser = XML::XSLT->new (< $DEBUGGING);
o
not ok
k
EOS
$parser->transform(\<csome random text
EOX
my $outstr = $parser->toString();
warn $outstr if $DEBUGGING;
my $correct = 'ok';
$parser->dispose();
die "$outstr ne $correct\n" unless $outstr eq $correct;
};
warn $@ if $DEBUGGING;
ok(!$@,"text node string gt");
eval
{
my $parser = XML::XSLT->new (< $DEBUGGING);
o
not ok
k
EOS
$parser->transform(\<csome random text
EOX
my $outstr = $parser->toString();
warn $outstr if $DEBUGGING;
my $correct = 'ok';
$parser->dispose();
die "$outstr ne $correct\n" unless $outstr eq $correct;
};
warn $@ if $DEBUGGING;
ok(!$@,"text node string ge");
eval
{
my $parser = XML::XSLT->new (< $DEBUGGING);
o
not ok
k
EOS
$parser->transform(\<bsome random text
EOX
my $outstr = $parser->toString();
warn $outstr if $DEBUGGING;
my $correct = 'ok';
$parser->dispose();
die "$outstr ne $correct\n" unless $outstr eq $correct;
};
warn $@ if $DEBUGGING;
ok(!$@,"text node string le");
eval
{
my $parser = XML::XSLT->new (< $DEBUGGING);
o
not ok
k
EOS
$parser->transform(\<42some random text
EOX
my $outstr = $parser->toString();
warn $outstr if $DEBUGGING;
my $correct = 'ok';
$parser->dispose();
die "$outstr ne $correct\n" unless $outstr eq $correct;
};
ok(!$@,"text node numeric eq");
eval
{
my $parser = XML::XSLT->new (< $DEBUGGING);
o
not ok
k
EOS
$parser->transform(\<43some random text
EOX
my $outstr = $parser->toString();
warn $outstr if $DEBUGGING;
my $correct = 'ok';
$parser->dispose();
die "$outstr ne $correct\n" unless $outstr eq $correct;
};
warn $@ if $DEBUGGING;
ok(!$@,"text node numeric ne");
eval
{
my $parser = XML::XSLT->new (< $DEBUGGING);
o
not ok
k
EOS
$parser->transform(\<41some random text
EOX
my $outstr = $parser->toString();
warn $outstr if $DEBUGGING;
my $correct = 'ok';
$parser->dispose();
die "$outstr ne $correct\n" unless $outstr eq $correct;
};
warn $@ if $DEBUGGING;
ok(!$@,"text node numeric lt");
eval
{
my $parser = XML::XSLT->new (< $DEBUGGING);
o
not ok
k
EOS
$parser->transform(\<43some random text
EOX
my $outstr = $parser->toString();
warn $outstr if $DEBUGGING;
my $correct = 'ok';
$parser->dispose();
die "$outstr ne $correct\n" unless $outstr eq $correct;
};
warn $@ if $DEBUGGING;
ok(!$@,"text node numeric gt");
eval
{
my $parser = XML::XSLT->new (< $DEBUGGING);
o
not ok
k
EOS
$parser->transform(\<43some random text
EOX
my $outstr = $parser->toString();
warn $outstr if $DEBUGGING;
my $correct = 'ok';
$parser->dispose();
die "$outstr ne $correct\n" unless $outstr eq $correct;
};
warn $@ if $DEBUGGING;
ok(!$@,"text node numeric ge");
eval
{
my $parser = XML::XSLT->new (< $DEBUGGING);
o
not ok
k
EOS
$parser->transform(\<41some random text
EOX
my $outstr = $parser->toString();
warn $outstr if $DEBUGGING;
my $correct = 'ok';
$parser->dispose();
die "$outstr ne $correct\n" unless $outstr eq $correct;
};
warn $@ if $DEBUGGING;
ok(!$@,"text node numeric le");
# attribute tests
eval
{
my $parser = XML::XSLT->new (<<'EOS', debug => $DEBUGGING);
o
not ok
k
EOS
$parser->transform(\<some random text
EOX
my $outstr = $parser->toString();
warn $outstr if $DEBUGGING;
my $correct = 'ok';
$parser->dispose();
die "$outstr ne $correct\n" unless $outstr eq $correct;
};
warn $@ if $DEBUGGING;
ok(!$@,"attribute string eq");
eval
{
my $parser = XML::XSLT->new (<<'EOS', debug => $DEBUGGING);
o
not ok
k
EOS
$parser->transform(\<some random text
EOX
my $outstr = $parser->toString();
warn $outstr if $DEBUGGING;
my $correct = 'ok';
$parser->dispose();
die "$outstr ne $correct\n" unless $outstr eq $correct;
};
ok(!$@,"attribute string ne");
eval
{
my $parser = XML::XSLT->new (<<'EOS', debug => $DEBUGGING);
o
not ok
k
EOS
$parser->transform(\<some random text
EOX
my $outstr = $parser->toString();
warn $outstr if $DEBUGGING;
my $correct = 'ok';
$parser->dispose();
die "$outstr ne $correct\n" unless $outstr eq $correct;
};
warn $@ if $DEBUGGING;
ok(!$@,"attribute string lt");
eval
{
my $parser = XML::XSLT->new (<<'EOS', debug => $DEBUGGING);
o
not ok
k
EOS
$parser->transform(\<some random text
EOX
my $outstr = $parser->toString();
warn $outstr if $DEBUGGING;
my $correct = 'ok';
$parser->dispose();
die "$outstr ne $correct\n" unless $outstr eq $correct;
};
warn $@ if $DEBUGGING;
ok(!$@,"attribute string gt");
eval
{
my $parser = XML::XSLT->new (<<'EOS', debug => $DEBUGGING);
o
not ok
k
EOS
$parser->transform(\<some random text
EOX
my $outstr = $parser->toString();
warn $outstr if $DEBUGGING;
my $correct = 'ok';
$parser->dispose();
die "$outstr ne $correct\n" unless $outstr eq $correct;
};
warn $@ if $DEBUGGING;
ok(!$@,"attribute string ge");
eval
{
my $parser = XML::XSLT->new (<<'EOS', debug => $DEBUGGING);
o
not ok
k
EOS
$parser->transform(\<some random text
EOX
my $outstr = $parser->toString();
warn $outstr if $DEBUGGING;
my $correct = 'ok';
$parser->dispose();
die "$outstr ne $correct\n" unless $outstr eq $correct;
};
warn $@ if $DEBUGGING;
ok(!$@,"attribute string le");
eval
{
my $parser = XML::XSLT->new (<<'EOS', debug => $DEBUGGING);
o
not ok
k
EOS
$parser->transform(\<some random text
EOX
my $outstr = $parser->toString();
warn $outstr if $DEBUGGING;
my $correct = 'ok';
$parser->dispose();
die "$outstr ne $correct\n" unless $outstr eq $correct;
};
ok(!$@,"attribute numeric eq");
eval
{
my $parser = XML::XSLT->new (<<'EOS', debug => $DEBUGGING);
o
not ok
k
EOS
$parser->transform(\<some random text
EOX
my $outstr = $parser->toString();
warn $outstr if $DEBUGGING;
my $correct = 'ok';
$parser->dispose();
die "$outstr ne $correct\n" unless $outstr eq $correct;
};
warn $@ if $DEBUGGING;
ok(!$@,"attribute numeric ne");
eval
{
my $parser = XML::XSLT->new (<<'EOS', debug => $DEBUGGING);
o
not ok
k
EOS
$parser->transform(\<some random text
EOX
my $outstr = $parser->toString();
warn $outstr if $DEBUGGING;
my $correct = 'ok';
$parser->dispose();
die "$outstr ne $correct\n" unless $outstr eq $correct;
};
warn $@ if $DEBUGGING;
ok(!$@,"attribute numeric lt");
eval
{
my $parser = XML::XSLT->new (<<'EOS', debug => $DEBUGGING);
o
not ok
k
EOS
$parser->transform(\<some random text
EOX
my $outstr = $parser->toString();
warn $outstr if $DEBUGGING;
my $correct = 'ok';
$parser->dispose();
die "$outstr ne $correct\n" unless $outstr eq $correct;
};
warn $@ if $DEBUGGING;
ok(!$@,"attribute numeric gt");
eval
{
my $parser = XML::XSLT->new (<<'EOS', debug => $DEBUGGING);
o
not ok
k
EOS
$parser->transform(\<some random text
EOX
my $outstr = $parser->toString();
warn $outstr if $DEBUGGING;
my $correct = 'ok';
$parser->dispose();
die "$outstr ne $correct\n" unless $outstr eq $correct;
};
warn $@ if $DEBUGGING;
ok(!$@,"attribute numeric ge");
eval
{
my $parser = XML::XSLT->new (<<'EOS', debug => $DEBUGGING);
o
not ok
k
EOS
$parser->transform(\<some random text
EOX
my $outstr = $parser->toString();
warn $outstr if $DEBUGGING;
my $correct = 'ok';
$parser->dispose();
die "$outstr ne $correct\n" unless $outstr eq $correct;
};
warn $@ if $DEBUGGING;
ok(!$@,"attribute numeric le");