blob: 3bc518f00d97c54e2a022ed66b4ab3a3a7ce8b34 [file] [log] [blame]
<project default="antunit" xmlns:au="antlib:org.apache.ant.antunit">
<import file="../antunit-base.xml" />
<property name="br" value="${line.separator}" />
<string id="input">foo
#pound
bar
//java sl
baz
REMark
</string>
<macrodef name="test">
<attribute name="lines" />
<element name="comments" implicit="true" />
<sequential>
<au:assertTrue>
<resourcecount count="@{lines}">
<tokens>
<concat>
<resource refid="input" />
<filterchain>
<striplinecomments>
<comments />
</striplinecomments>
<ignoreblank />
</filterchain>
</concat>
</tokens>
</resourcecount>
</au:assertTrue>
</sequential>
</macrodef>
<target name="testBasic">
<test lines="5">
<comment value="#" />
</test>
</target>
<target name="testMultiple">
<test lines="3">
<comment value="#" />
<comment value="//" />
<comment value="REM" />
</test>
</target>
<target name="testNestedText">
<test lines="3">
<comment>#</comment>
<comment>//</comment>
<comment>REM</comment>
</test>
</target>
<target name="testExclusivity">
<au:expectfailure>
<filterchain>
<striplinecomments>
<comment value="#">#"</comment>
</striplinecomments>
</filterchain>
</au:expectfailure>
</target>
</project>