CVS Update: xmlpull-api-v1/src/xml/tests
Aleksander Andrzej Slominski <[email protected]>
| Newsgroups | gmane.text.xml.xmlpull.devel |
|---|---|
| Message-ID | <[email protected]> |
aslom 02/07/31 16:33:26
Added: src/xml/tests cdsect.xml simple.xml typical.xml
Log:
added some simple XML tests
Revision Changes Path
1.1 xmlpull-api-v1/src/xml/tests/cdsect.xml
Index: cdsect.xml
===================================================================
<tests xmlns="http://xmlpull.org/v1/tests/2002-08.xsd">
<!-- this initial test for CDATA handling -->
<test-parser name="CDSECT handling">
<create-parser/>
<input-inline><foo>
<t> <![CDATA[fo]]>o<![CDATA[ ]]></t>
</foo> </input-inline>
<set-feature>http://xmlpull.org/v1/doc/features.html#process-namespaces</set-feature>
<expect type="START_DOCUMENT"/>
<next/>
<expect type="START_TAG" namespace="" name="foo" empty="false"/>
<next-tag/>
<expect type="START_TAG" namespace="" name="t"/>
<next-text text=" foo "/>
<expect type="END_TAG" namespace="" name="t" />
<next-tag/>
<expect type="END_TAG" namespace="" name="foo" />
<next/>
<expect type="END_DOCUMENT"/>
</test-parser>
<!-- now more of complex tests -->
<test-parser name="more CDSECT handling">
<create-parser/>
<input-inline><foo>
<t><![CDATA[ foo]]> </t>
<t><![CDATA[ foo ]]></t>
<t> <![CDATA[foo ]]></t>
<t><![CDATA[ foo]]> </t>
<t> <![CDATA[foo]]> </t>
<t> <![CDATA[fo]]><![CDATA[o]]> </t>
<t> <![CDATA[fo]]>o<![CDATA[ ]]></t>
<t> <![CDATA[f]]>o<![CDATA[o]]> </t>
<t><![CDATA[ f]]>o<![CDATA[o ]]></t>
</foo> </input-inline>
<set-feature>http://xmlpull.org/v1/doc/features.html#process-namespaces</set-feature>
<expect type="START_DOCUMENT"/>
<next/>
<expect type="START_TAG" namespace="" name="foo" empty="false"/>
<next-tag/>
<expect type="START_TAG" namespace="" name="t"/>
<next-text text=" foo "/>
<next-tag/>
<expect type="START_TAG" namespace="" name="t"/>
<next-text text=" foo "/>
<next-tag/>
<expect type="START_TAG" namespace="" name="t"/>
<next-text text=" foo "/>
<next-tag/>
<expect type="START_TAG" namespace="" name="t"/>
<next-text text=" foo "/>
<next-tag/>
<expect type="START_TAG" namespace="" name="t"/>
<next-text text=" foo "/>
<next-tag/>
<expect type="START_TAG" namespace="" name="t"/>
<next-text text=" foo "/>
<next-tag/>
<expect type="START_TAG" namespace="" name="t"/>
<next-text text=" foo "/>
<next-tag/>
<expect type="START_TAG" namespace="" name="t"/>
<next-text text=" foo "/>
<next-tag/>
<expect type="START_TAG" namespace="" name="t"/>
<next-text text=" foo "/>
<next-tag/>
<expect type="END_TAG" namespace="" name="foo" />
<next/>
<expect type="END_DOCUMENT"/>
</test-parser>
</tests>
1.1 xmlpull-api-v1/src/xml/tests/simple.xml
Index: simple.xml
===================================================================
<tests xmlns="http://xmlpull.org/v1/tests/2002-08.xsd">
<test-parser name="initial test">
<create-parser/> <input-inline><![CDATA[ <foo>bar</foo> ]]></input-inline>
<set-feature>http://xmlpull.org/v1/doc/features.html#process-namespaces</set-feature>
<expect type="START_DOCUMENT"/>
<next/><expect type="START_TAG" namespace="" name="foo" empty="false"/>
<next-text text="bar"/>
<next/><expect type="END_DOCUMENT"/>
</test-parser>
</tests>
<!--tests xmlns="http://xmlpull.org/v1/tests/2002-08.xsd">
<test-parser name="initial test">
<create-parser/>
<input-inline><![CDATA[ <foo></foo> ]]></input-inline>
<set-feature>http://xmlpull.org/v1/doc/features.html#process-namespaces</set-feature>
<expect type="START_DOCUMENT"/>
<next/> <!-- instead of: <execute method="next()"/> ->
<expect type="START_TAG" namespace="" name="foo" empty="false"/>
<!-- instead of: <execute method="isEmptyElement()" into="t1" />
<assertVar name="t1" value="true" /> ->
<next/>
<expect type="END_TAG" namespace="" name="foo" />
<next/>
<expect type="END_DOCUMENT"/>
</test-parser>
</tests-->
1.1 xmlpull-api-v1/src/xml/tests/typical.xml
Index: typical.xml
===================================================================
<tests xmlns="http://xmlpull.org/v1/tests/2002-08.xsd">
<test-parser name="typical XML">
<create-parser/> <input-inline><![CDATA[ <foo>bar&baz</foo> ]]></input-inline>
<set-feature>http://xmlpull.org/v1/doc/features.html#process-namespaces</set-feature>
<expect type="START_DOCUMENT"/>
<next/><expect type="START_TAG" namespace="" name="foo" empty="false"/>
<next-text text="bar&baz"/>
<next/><expect type="END_DOCUMENT"/>
</test-parser>
</tests>