Browse Source

-au version of dirnametest

git-svn-id: https://svn.apache.org/repos/asf/ant/core/trunk@540026 13f79535-47bb-0310-9956-ffa450edef68
master
Kevin Jackson 18 years ago
parent
commit
038aaa970e
1 changed files with 43 additions and 0 deletions
  1. +43
    -0
      src/tests/antunit/taskdefs/dirname-test.xml

+ 43
- 0
src/tests/antunit/taskdefs/dirname-test.xml View File

@@ -0,0 +1,43 @@
<?xml version="1.0"?>
<project name="dirname-test" basedir="." default="antunit" xmlns:au="antlib:org.apache.ant.antunit">
<import file="../antunit-base.xml"/>
<target name="test1">
<au:expectfailure expectedmessage="property attribute required">
<dirname/>
</au:expectfailure>
</target>
<target name="test2">
<au:expectfailure expectedmessage="file attribute required">
<dirname property="propname"/>
</au:expectfailure>
</target>
<target name="test3">
<au:expectfailure expectedmessage="property attribute required">
<dirname file="filename"/>
</au:expectfailure>
</target>
<target name="init-test4">
<condition property="valid.os">
<and>
<not><os family="dos"/></not><not><os family="netware"/></not>
</and>
</condition>
</target>
<target name="test4" depends="init-test4" if="valid.os">
<dirname property="local.dir" file="/usr/local/foo.txt"/>
<au:assertPropertyEquals name="local.dir"
value="${file.separator}usr${file.separator}local${file.separator}foo.txt"/>
</target>
<target name="test5">
<dirname property="base.dir" file="foo.txt"/>
<au:assertPropertyEquals name="base.dir" value="${basedir}"/>
</target>
</project>

Loading…
Cancel
Save