Skip to content

manakai/testdataparser

master
Switch branches/tags
Code

Latest commit

 

Git stats

Files

Permalink
Failed to load latest commit information.
Type
Name
Latest commit message
Commit time
 
 
t
 
 
 
 
 
 
 
 
 
 
=head1 NAME

Test::HTCT::Parser - A parser for test data in HTML Tree Construction Tests format

=head1 SYNOPSIS

  use Test::HTCT::Parser;
  
  for_each_test $file_name, {
    data => {},
    errors => {is_list => 1},
    document => {is_prefixed => 1},
    'document-fragment' => {is_prefixed => 1},
  }, sub {
    my $test = shift;
    my ($serialized, $errors) = parse_data ($test->{data}->[0]);
    is $serialized, $test->{document}->[0];
    is_deeply $errors, $test->{errors}->[0];
  };

=head1 DESCRIPTION

The C<Test::HTCT::Parser> module exports a function to parse test data
file encoded in the format for HTML Parsers' Tree Construction Tests.
It can also be used to parse test data for other purposes than HTML
parsing.

For more information on the usage of the module, see
C<t/test-htct-parser.t> test script.

=head1 TEST CALLBACK

The callback code is invoked for each test, in order in the input test
data file.  It is invoked with two arguments.

The first argument C<$_[0]> represents the test data.

The second argument C<$_[1]> has additional data.  It is a hash
reference with a key/value pair: C<line_number> is the line number of
the first line of the test data in the input test data file.

=head1 SEE ALSO

WHATWG Wiki, Parser tests, Tree Constructoion Tests
<https://wiki.whatwg.org/wiki/Parser_tests#Tree_Construction_Tests>.

HTML Parser Tree Constructions Tests (from html5lib repository)
<http://html5lib.googlecode.com/svn/trunk/testdata/tree-construction/>.

sami-test.js, which is a JavaScript implementation of the format
<https://github.com/wakaba/samijs/blob/master/sami/script/sami-test.js>.

=head1 DISTRIBUTION

The latest version of the module is available from the GitHub
repository: <https://github.com/wakaba/testdataparser>.

=head1 DEPENDENCY

The module requires Perl 5.8 or later.

=head1 AUTHOR

Wakaba <wakaba@suikawiki.org>.

The format was originally defined by WHATWG/html5lib contributors.

=head1 HISTORY

The parser was originally developed as part of L<Whatpm::HTML> HTML
parser module, which is part of the manakai package
<https://suika.suikawiki.org/www/manakai-core/doc/web/>.

The first version, C<1.0>, as a standalone module with new name
L<Test::HTCT::Parser> is released on February 19, 2011.

The second version, C<2.0>, added support for C<multiple> fields.

This repository was located at
<https://github.com/wakaba/testdataparser> until it has been
transferred to the manakai project on Nobember 4, 2021.

=head1 LICENSE

Copyright 2007-2021 Wakaba <wakaba@suikawiki.org>.

This program is free software; you can redistribute it and/or modify
it under the same terms as Perl itself.

=cut

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published