/[suikacvs]/markup/html/whatpm/t/HTML-tokenizer.t
Suika

Diff of /markup/html/whatpm/t/HTML-tokenizer.t

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

revision 1.28 by wakaba, Mon Mar 3 11:56:18 2008 UTC revision 1.34 by wakaba, Sun Apr 13 06:44:27 2008 UTC
# Line 26  BEGIN { Line 26  BEGIN {
26  }  }
27    
28  use Test;  use Test;
29  BEGIN { plan tests => 471 }  BEGIN { plan tests => 477 }
30    
31  use Data::Dumper;  use Data::Dumper;
32  $Data::Dumper::Useqq = 1;  $Data::Dumper::Useqq = 1;
# Line 37  sub Data::Dumper::qquote { Line 37  sub Data::Dumper::qquote {
37  } # Data::Dumper::qquote  } # Data::Dumper::qquote
38    
39  if ($DEBUG) {  if ($DEBUG) {
40    my $not_found = {%$Whatpm::HTML::Debug::cp};    my $not_found = {%{$Whatpm::HTML::Debug::cp or {}}};
41    
42    $Whatpm::HTML::Debug::cp_pass = sub {    $Whatpm::HTML::Debug::cp_pass = sub {
43      my $id = shift;      my $id = shift;
# Line 45  if ($DEBUG) { Line 45  if ($DEBUG) {
45    };    };
46    
47    END {    END {
48      for my $id (sort {$a <=> $b || $a cmp $b} keys %$not_found) {      for my $id (sort {$a <=> $b || $a cmp $b} grep {!/^[ti]/}
49                    keys %$not_found) {
50        print "# checkpoint $id is not reached\n";        print "# checkpoint $id is not reached\n";
51      }      }
52    }    }
# Line 60  for my $file_name (grep {$_} split /\s+/ Line 61  for my $file_name (grep {$_} split /\s+/
61                        ${dir_name}test4.test                        ${dir_name}test4.test
62                        ${dir_name}contentModelFlags.test                        ${dir_name}contentModelFlags.test
63                        ${dir_name}escapeFlag.test                        ${dir_name}escapeFlag.test
64                          ${dir_name}entities.test
65                          ${dir_name}xmlViolation.test
66                        ${test_dir_name}tokenizer-test-1.test                        ${test_dir_name}tokenizer-test-1.test
67                       ]) {                       ]) {
68    open my $file, '<', $file_name    open my $file, '<', $file_name
# Line 79  for my $file_name (grep {$_} split /\s+/ Line 82  for my $file_name (grep {$_} split /\s+/
82      $c += ((((hex $1) & 0b1111111111) << 10) | ((hex $2) & 0b1111111111));      $c += ((((hex $1) & 0b1111111111) << 10) | ((hex $2) & 0b1111111111));
83      chr $c;      chr $c;
84    }gex;    }gex;
85    my $tests = jsonToObj ($js)->{tests};    my $json = jsonToObj ($js);
86      my $tests = $json->{tests} || $json->{xmlViolationTests};
87    TEST: for my $test (@$tests) {    TEST: for my $test (@$tests) {
88      my $s = $test->{input};      my $s = $test->{input};
89            
# Line 155  for my $file_name (grep {$_} split /\s+/ Line 159  for my $file_name (grep {$_} split /\s+/
159          $test_token->[1] = $token->{data} if defined $token->{data};          $test_token->[1] = $token->{data} if defined $token->{data};
160          if ($token->{type} == Whatpm::HTML::START_TAG_TOKEN ()) {          if ($token->{type} == Whatpm::HTML::START_TAG_TOKEN ()) {
161            $test_token->[2] = {map {$_->{name} => $_->{value}} values %{$token->{attributes}}};            $test_token->[2] = {map {$_->{name} => $_->{value}} values %{$token->{attributes}}};
162              if ({
163                   ## NOTE: Permitted slash
164                   br => 1, link => 1,
165                  }->{$token->{tag_name}}) {
166                delete $p->{self_closing};
167              }
168          } elsif ($token->{type} == Whatpm::HTML::DOCTYPE_TOKEN ()) {          } elsif ($token->{type} == Whatpm::HTML::DOCTYPE_TOKEN ()) {
169            $test_token->[1] = $token->{name};            $test_token->[1] = $token->{name};
170            $test_token->[2] = $token->{public_identifier};            $test_token->[2] = $token->{public_identifier};

Legend:
Removed from v.1.28  
changed lines
  Added in v.1.34

[email protected]
ViewVC Help
Powered by ViewVC 1.1.24