ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Steve Loughran" <stev...@iseran.com>
Subject testing <condition>
Date Sun, 13 Jan 2002 23:29:21 GMT
I am adding a new condition, <filesmatch> which will test two files for
byte-for-byte compatibility; good for deployment testing.

To do this I have had to
    -add another entry to the conditon list; we need some kind of
introspection helper
    -write the test code for condition.

I am filing bug reports for <condition> as I go. One thing I am not filing
is the fact that <and> and <or> with one parameter each

  <target name="orincomplete">
    <condition property="orincomplete">
      <or>
        <equals arg1="a" arg2="a" />
      </or>
    </condition>
    <echo>${orincomplete}</echo>
  </target>

  <target name="andincomplete">
    <condition property="andincomplete">
      <and>
        <equals arg1="a" arg2="B" />
      </and>
    </condition>
    <echo>${andincomplete}</echo>
  </target>

are both successful; I am not sure this is valid or not.


Now for some more fun, what if there are no child tests?

  <target name="orempty">
    <condition property="orempty">
      <or/>
    </condition>
    <echo>${orempty}</echo>
  </target>

or does not set the property; it is effectively returning false

Empty and :

  <target name="andempty">
    <condition property="andempty">
      <and/>
    </condition>
    <echo>${andempty}</echo>
  </target>

returns true, which is a very wierd bit of logic "if there is no test,
return true".

What should the correct behaviour be?


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


Mime
View raw message