The manakai project

Test::HTCT::Parser

A parser for test data in HTML Tree Construction Tests format

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];
  };

DESCRIPTION

The 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 t/test-htct-parser.t test script.

SEE ALSO

WHATWG Wiki, Parser tests, Tree Constructoion Tests <http://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>.

DISTRIBUTION

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

DEPENDENCY

The module requires Perl 5.8 or later.

AUTHOR

Wakaba <wakaba@suikawiki.org>.

The format was originally defined by WHATWG/html5lib contributors.

HISTORY

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

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

The second version, 2.0, added support for multiple fields.

LICENSE

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

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