Table cells may contain HTML lists. Consider the following tests:
!|fitlibrary.specify.DoTree|
|check|tree|!-
-!|
|check|tree|!-Top-!|
|show|tree|
|show|tree||
For such lists to be handled correctly, the corresponding types (method arguments and return types) have to be subtypes of the special !-FitLibrary-! type ''Tree''.
The methods of ''!-DoTree-!'' are as follows:
----{{{public class DoTree {
public ListTree tree() {
ListTree tree = new ListTree("");
tree.addChild(new ListTree("a"));
tree.addChild(new ListTree("BB"));
return tree;
}
public ListTree tree(String s) {
return ListTree.parse(s);
}
...
}}}----
This works because class ''!-ListTree-!'' is a subtype of ''Tree''. The fixture treats the HTML list as a tree structure. Here's ^AnotherTreeExample.
It's easy to define new subtypes of ''Tree''. See the code for details.
----The following specifies the expected counts of passes, fails, etc for the page. This is used here to avoid manually checking, as here the storytests are written to fail. You'll most probably not use this technique, as you'd expect all your storytests to pass. There are other approaches to testing for errors, etc.
|''expected test results''|1|''right''|1|''wrong''|0|''ignored''|0|''exceptions''|