ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From k...@apache.org
Subject svn commit: r540026 - /ant/core/trunk/src/tests/antunit/taskdefs/dirname-test.xml
Date Mon, 21 May 2007 04:42:35 GMT
Author: kevj
Date: Sun May 20 21:42:34 2007
New Revision: 540026

URL: http://svn.apache.org/viewvc?view=rev&rev=540026
Log:
-au version of dirnametest

Added:
    ant/core/trunk/src/tests/antunit/taskdefs/dirname-test.xml

Added: ant/core/trunk/src/tests/antunit/taskdefs/dirname-test.xml
URL: http://svn.apache.org/viewvc/ant/core/trunk/src/tests/antunit/taskdefs/dirname-test.xml?view=auto&rev=540026
==============================================================================
--- ant/core/trunk/src/tests/antunit/taskdefs/dirname-test.xml (added)
+++ ant/core/trunk/src/tests/antunit/taskdefs/dirname-test.xml Sun May 20 21:42:34 2007
@@ -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>
\ No newline at end of file



---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@ant.apache.org
For additional commands, e-mail: dev-help@ant.apache.org


Mime
View raw message