git-svn-id: https://svn.apache.org/repos/asf/ant/core/trunk@497528 13f79535-47bb-0310-9956-ffa450edef68master
@@ -40,6 +40,8 @@ Fixed bugs: | |||||
* Synchonization issues in PropertyHelper. Bugzilla 41353. | * Synchonization issues in PropertyHelper. Bugzilla 41353. | ||||
* <concat binary="true" append="true"> did not append. Bugzilla 41399. | |||||
Other changes: | Other changes: | ||||
-------------- | -------------- | ||||
@@ -479,7 +479,7 @@ public class Concat extends Task { | |||||
InputStream in = null; | InputStream in = null; | ||||
try { | try { | ||||
try { | try { | ||||
out = new FileOutputStream(destinationFile); | |||||
out = new FileOutputStream(destinationFile, append); | |||||
} catch (Exception t) { | } catch (Exception t) { | ||||
throw new BuildException("Unable to open " | throw new BuildException("Unable to open " | ||||
+ destinationFile + " for writing", t); | + destinationFile + " for writing", t); | ||||
@@ -0,0 +1,24 @@ | |||||
<project xmlns:au="antlib:org.apache.ant.antunit"> | |||||
<target name="tearDown"> | |||||
<delete file="binaryAppendDest" /> | |||||
</target> | |||||
<target name="testBinaryAppend"> | |||||
<au:assertTrue message="prerequisite conditions unmet"> | |||||
<length length="0"> | |||||
<!-- allow for nonexistent OR zero-length: --> | |||||
<fileset file="binaryAppendDest" /> | |||||
</length> | |||||
</au:assertTrue> | |||||
<echo file="binaryAppendDest">x</echo> | |||||
<au:assertTrue message="destfile setup failed"> | |||||
<length length="1" file="binaryAppendDest" /> | |||||
</au:assertTrue> | |||||
<concat append="true" destfile="binaryAppendDest" binary="true"> | |||||
<string value="x" /> | |||||
</concat> | |||||
<au:assertTrue message="expected length 2"> | |||||
<length file="binaryAppendDest" length="2" /> | |||||
</au:assertTrue> | |||||
</target> | |||||
</project> |