This is an automated email from the ASF dual-hosted git repository.

bodewig pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/ant.git

commit ad623758675a78c1c487f4a5f820d03e37c0e840
Author: Stefan Bodewig <[email protected]>
AuthorDate: Sun Feb 8 08:53:40 2026 +0100

    test deletion of dangling junctions as well
---
 .../antunit/taskdefs/delete-and-junctions-test.xml | 29 ++++++++++++++++++++++
 1 file changed, 29 insertions(+)

diff --git a/src/tests/antunit/taskdefs/delete-and-junctions-test.xml 
b/src/tests/antunit/taskdefs/delete-and-junctions-test.xml
index bde893262..415cd3832 100644
--- a/src/tests/antunit/taskdefs/delete-and-junctions-test.xml
+++ b/src/tests/antunit/taskdefs/delete-and-junctions-test.xml
@@ -66,4 +66,33 @@
     </delete>
     <au:assertFileExists file="${input}/A/B/C"/>
   </target>
+
+  <target name="prepare-dangling-tests">
+    <property name="existing.dir" location="${output}/exists"/>
+    <delete dir="${output}"/>
+    <mkdir dir="${output}"/>
+    <mkdir dir="${existing.dir}"/>
+  </target>
+
+  <target name="testDanglingJunctionInDir" if="windows_os"
+          depends="prepare-dangling-tests">
+    <mkdir dir="${output}/foo"/>
+    <mklink link="${existing.dir}/link" targetFile="${output}/foo"/>
+    <delete dir="${output}/foo"/>
+    <delete dir="${existing.dir}"/>
+    <au:assertFileDoesntExist file="${existing.dir}" />
+  </target>
+
+  <target name="testDanglingJunction" if="windows_os"
+          depends="prepare-dangling-tests">
+    <mkdir dir="${output}/foo"/>
+    <mklink link="${existing.dir}/link" targetFile="${output}/foo"/>
+    <delete dir="${output}/foo"/>
+    <delete dir="${output}/link"/>
+
+    <!-- since File.exists returns false for dangling links, recreate
+         the file so that assertFileDoesntExist can actually work -->
+    <mkdir dir="${output}/foo"/>
+    <au:assertFileDoesntExist file="${output}/link" />
+  </target>
 </project>

Reply via email to