summaryrefslogtreecommitdiff
path: root/test/tokeniser.c
diff options
context:
space:
mode:
authorAndrew Sidwell <andy@entai.co.uk>2008-06-16 05:37:06 +0000
committerAndrew Sidwell <andy@entai.co.uk>2008-06-16 05:37:06 +0000
commit32386253b3e285406fc5bc5cbd2567b14a18524f (patch)
tree23824c752b7dd5e60e7a88042b21e2b5e70e5d38 /test/tokeniser.c
parentdfdc3e098d65ebcd7bc0c247d179201f81132ccb (diff)
downloadlibhubbub-32386253b3e285406fc5bc5cbd2567b14a18524f.tar.gz
libhubbub-32386253b3e285406fc5bc5cbd2567b14a18524f.tar.bz2
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
Diffstat (limited to 'test/tokeniser.c')
-rw-r--r--test/tokeniser.c28
1 files changed, 24 insertions, 4 deletions
diff --git a/test/tokeniser.c b/test/tokeniser.c
index 32ecdbc..2d9577b 100644
--- a/test/tokeniser.c
+++ b/test/tokeniser.c
@@ -126,15 +126,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++) {
@@ -146,9 +164,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++) {