From 32386253b3e285406fc5bc5cbd2567b14a18524f Mon Sep 17 00:00:00 2001 From: Andrew Sidwell Date: Mon, 16 Jun 2008 05:37:06 +0000 Subject: Update the testsuite to match the tokeniser. Also, import new html5lib tests for better coverage. Known issue: the tokeniser test stalls using the testrunner script. svn path=/trunk/hubbub/; revision=4356 --- test/parser.c | 28 ++++++++++++++++++++++++---- 1 file changed, 24 insertions(+), 4 deletions(-) (limited to 'test/parser.c') diff --git a/test/parser.c b/test/parser.c index fa2afb8..0bc9246 100644 --- a/test/parser.c +++ b/test/parser.c @@ -127,15 +127,33 @@ void token_handler(const hubbub_token *token, void *pw) switch (token->type) { case HUBBUB_TOKEN_DOCTYPE: - printf("'%.*s' (%svalid)\n", + printf("'%.*s' %sids:\n", (int) token->data.doctype.name.len, pbuffer + token->data.doctype.name.data.off, - token->data.doctype.correct ? "" : "in"); + token->data.doctype.force_quirks ? + "(force-quirks) " : ""); + + if (token->data.doctype.public_missing) + printf("\tpublic: missing\n"); + else + printf("\tpublic: '%.*s'\n", + (int) token->data.doctype.public_id.len, + pbuffer + token->data.doctype.public_id.data.off); + + if (token->data.doctype.system_missing) + printf("\tsystem: missing\n"); + else + printf("\tsystem: '%.*s'\n", + (int) token->data.doctype.system_id.len, + pbuffer + token->data.doctype.system_id.data.off); + break; case HUBBUB_TOKEN_START_TAG: - printf("'%.*s' %s\n", + printf("'%.*s' %s%s\n", (int) token->data.tag.name.len, pbuffer + token->data.tag.name.data.off, + (token->data.tag.self_closing) ? + "(self-closing) " : "", (token->data.tag.n_attributes > 0) ? "attributes:" : ""); for (i = 0; i < token->data.tag.n_attributes; i++) { @@ -147,9 +165,11 @@ void token_handler(const hubbub_token *token, void *pw) } break; case HUBBUB_TOKEN_END_TAG: - printf("'%.*s' %s\n", + printf("'%.*s' %s%s\n", (int) token->data.tag.name.len, pbuffer + token->data.tag.name.data.off, + (token->data.tag.self_closing) ? + "(self-closing) " : "", (token->data.tag.n_attributes > 0) ? "attributes:" : ""); for (i = 0; i < token->data.tag.n_attributes; i++) { -- cgit v1.2.3