Has anybody else complained about the shortcut logic failures for expressions in 0.85-rc1?  Here's a quote from the documentation:

1.     This will check for the existence of a file version.txt in a directory specified by myprj.basedir. Note that this makes use of the short-circuit evaluation supported by NAnt, so you can test for the existence of the file and check its length in the same _expression_. ( ie like C, NAnt will not evaluate the second part of an 'or' _expression_ if the first evaluates to true )

Here're two examples that I would expect to work, but don't:

 

      <if test="${property::exists('testprop') and property::get-value('testprop') >= '' }">

            <fail message="The property 'testprop' is specified." />

      </if>

      <if test="${not property::exists('testprop') or property::get-value('testprop') <= '' }">

            <fail message="The property 'testprop' must be specified." />

      </if>

 

Both generate the same error when testprop doesn't exist: "Function call failed." and "Property 'testprop' has not been set." 

 

The test doesn't shortcut the way I would expect.  :(  Having to nest tests to shield fragile methods defeats the purpose of having shortcut logic...

Reply via email to