/[suikacvs]/markup/html/whatpm/t/XML-Parser.t
Suika

Diff of /markup/html/whatpm/t/XML-Parser.t

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.1 by wakaba, Tue Oct 14 09:00:57 2008 UTC revision 1.11 by wakaba, Fri Oct 17 07:14:29 2008 UTC
# Line 88  sub test ($) { Line 88  sub test ($) {
88    }    }
89        
90    warn "No #errors section ($test->{data}->[0])" unless $test->{errors};    warn "No #errors section ($test->{data}->[0])" unless $test->{errors};
91    
92      @errors = sort {$a cmp $b} @errors;
93      @{$test->{errors}->[0]} = sort {$a cmp $b} @{$test->{errors}->[0] ||= []};
94        
95    ok join ("\n", @errors), join ("\n", @{$test->{errors}->[0] or []}),    ok join ("\n", @errors), join ("\n", @{$test->{errors}->[0] or []}),
96      'Parse error: ' . Data::Dumper::qquote ($test->{data}->[0]) . '; ' .      'Parse error: ' . Data::Dumper::qquote ($test->{data}->[0]);
97      join (', ', @errors) . ';' . join (', ', @{$test->{errors}->[0] or []});  
98      if ($test->{'xml-version'}) {
99        ok $doc->xml_version, $test->{'xml-version'}->[0],
100            'XML version: ' . Data::Dumper::qquote ($test->{data}->[0]);
101      }
102    
103      if ($test->{'xml-encoding'}) {
104        if ($test->{'xml-encoding'}->[1]->[0] eq 'null') {
105          ok $doc->xml_encoding, undef,
106            'XML encoding: ' . Data::Dumper::qquote ($test->{data}->[0]);
107        } else {
108          ok $doc->xml_encoding, $test->{'xml-encoding'}->[0],
109              'XML encoding: ' . Data::Dumper::qquote ($test->{data}->[0]);
110        }
111      }
112    
113      if ($test->{'xml-standalone'}) {
114        ok $doc->xml_standalone ? 1 : 0,
115            $test->{'xml-standalone'}->[1]->[0] eq 'true' ? 1 : 0,
116            'XML standalone: ' . Data::Dumper::qquote ($test->{data}->[0]);
117      }
118        
119    $test->{document}->[0] .= "\x0A" if length $test->{document}->[0];    $test->{document}->[0] .= "\x0A" if length $test->{document}->[0];
120    ok $result, $test->{document}->[0],    ok $result, $test->{document}->[0],
# Line 99  sub test ($) { Line 122  sub test ($) {
122  } # test  } # test
123    
124  my @FILES = grep {$_} split /\s+/, qq[  my @FILES = grep {$_} split /\s+/, qq[
125                        ${test_dir_name}tree-1.dat    ${test_dir_name}elements-1.dat
126                       ];    ${test_dir_name}attrs-1.dat
127      ${test_dir_name}texts-1.dat
128      ${test_dir_name}cdata-1.dat
129      ${test_dir_name}charref-1.dat
130      ${test_dir_name}comments-2.dat
131      ${test_dir_name}pis-1.dat
132      ${test_dir_name}pis-2.dat
133      ${test_dir_name}xmldecls-1.dat
134      ${test_dir_name}tree-1.dat
135      ${test_dir_name}ns-elements-1.dat
136      ${test_dir_name}ns-attrs-1.dat
137      ${test_dir_name}doctypes-1.dat
138      ${test_dir_name}doctypes-2.dat
139      ${test_dir_name}attlists-1.dat
140    ];
141    
142  require 't/testfiles.pl';  require 't/testfiles.pl';
143  execute_test ($_, {  execute_test ($_, {

Legend:
Removed from v.1.1  
changed lines
  Added in v.1.11

admin@suikawiki.org
ViewVC Help
Powered by ViewVC 1.1.24