[Imps] Adding "content model flags" to tokenization tests
t.broyer at gmail.com
Fri Dec 29 03:30:05 PST 2006
2006/12/28, Thomas Broyer:
> 2006/12/23, James Graham:
> >  An example of something that, at present can only be checked
> > through a parser test is the proper tokenizing of a fragment like
> > <plaintext><head>&body;
> How about adding a new "parameter" to tests to set the initial
> "content model flag" (defaulting to "PCDATA" if not present)?
I've finally created some test cases (attached) with a
"contentModelFlags" property whose value is a list of "content model
flag"s. The test case is then run successively with the same input and
expected output but initialized with a different "content model flag".
If the property is not given, it defaults to ["PCDATA"] (a list with a
single value "PCDATA").
Some tests from test1.test and test2.test should be updated to be run
within PCDATA and RCDATA and/or CDATA "modes" (the last test case in
the attached suite should really be merged into test1.test)
For CDATA and RCDATA, I've added a "lastStartTag" property to
initialize the "last emitted start tag name", when needed (i.e. when
the input contains "</")
IMO, tree-construction tests should only deal with switching to the
proper "content model flag" depending on the start tag name along with
correct passing of the "last emitted start tag name" to the tokenizer.
-------------- next part --------------
A non-text attachment was scrubbed...
Size: 1111 bytes
Desc: not available
More information about the Implementors