File: 05quick.t

package info (click to toggle)
libxml-libxslt-perl 2.003000-3
  • links: PTS, VCS
  • area: main
  • in suites: sid
  • size: 704 kB
  • sloc: xml: 2,181; perl: 1,227; ansic: 402; makefile: 24
file content (71 lines) | stat: -rw-r--r-- 1,904 bytes parent folder | download | duplicates (7)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71

use strict;
use warnings;

# Should be 12.
use Test::More tests => 12;

use XML::LibXSLT;
use XML::LibXML;

# this test is here because Mark Cox found a segfault
# that occurs when parse_stylesheet is immediately followed
# by a transform()

my $parser = XML::LibXML->new();
my $xslt = XML::LibXSLT->new();
# TEST
ok($parser, ' TODO : Add test name'); # TEST
 ok($xslt, ' TODO : Add test name');
my $source = $parser->parse_file('example/1.xml');
# TEST
ok($source, ' TODO : Add test name');

my ($out1, $out2);

{
my $style_doc = $parser->parse_file('example/1.xsl');
my $stylesheet = $xslt->parse_stylesheet($style_doc);
my $results = $stylesheet->transform($source);
$out1 = $stylesheet->output_string($results);
# TEST
ok($out1, ' TODO : Add test name');
}

{
$source = $parser->parse_file('example/2.xml');
# TEST
ok($source, ' TODO : Add test name');
my $style_doc = $parser->parse_file('example/2.xsl');
my $stylesheet = $xslt->parse_stylesheet($style_doc);
my $results = $stylesheet->transform($source);
# TEST
ok($stylesheet->media_type, ' TODO : Add test name');
# TEST
ok($stylesheet->output_method, ' Test existence of output method');
$out2 = $stylesheet->output_string($results);
# TEST
ok($out2, ' TODO : Add test name');
}

{
  my $style_doc = $parser->parse_file('example/1.xsl');
  my $stylesheet = $xslt->parse_stylesheet($style_doc);
  my $results = $stylesheet->transform_file('example/1.xml');
  my $out = $stylesheet->output_string($results);
  # TEST
  ok ($out, ' TODO : Add test name' );
  # TEST
  is ($out1, $out, ' TODO : Add test name' );
}

{
  my $style_doc = $parser->parse_file('example/2.xsl');
  my $stylesheet = $xslt->parse_stylesheet($style_doc);
  my $results = $stylesheet->transform_file('example/2.xml');
  my $out = $stylesheet->output_string($results);
  # TEST
  ok( $out, ' TODO : Add test name' );
  # TEST
  is ($out2, $out, ' TODO : Add test name' );
}