From d3fddfe7de595c078c047b74cb2d064dfdf251be Mon Sep 17 00:00:00 2001
From: Ambre Austen Suhamy <ambre@tarides.com>
Date: Sat, 11 Jan 2025 00:26:07 +0100
Subject: [PATCH] Added newly passing test

Signed-off-by: Ambre Austen Suhamy <ambre@tarides.com>
---
 .../test-cases/promote/deep-subdir.t          | 39 +++++++++++++++++++
 1 file changed, 39 insertions(+)
 create mode 100644 test/blackbox-tests/test-cases/promote/deep-subdir.t

diff --git a/test/blackbox-tests/test-cases/promote/deep-subdir.t b/test/blackbox-tests/test-cases/promote/deep-subdir.t
new file mode 100644
index 000000000000..d16521df0738
--- /dev/null
+++ b/test/blackbox-tests/test-cases/promote/deep-subdir.t
@@ -0,0 +1,39 @@
+Tests for promoting directory targets
+-------------------------------------
+
+  $ cat > dune-project << EOF
+  > (lang dune 3.0)
+  > (using directory-targets 0.1)
+  > EOF
+
+  $ cat > dune << EOF
+  > (rule
+  >  (deps
+  >    (source_tree deep))
+  >  (targets
+  >    (dir deep_copied))
+  >  (mode promote)
+  >  (action
+  >    (run cp -r deep deep_copied)))
+
+Let's create the directory structure we are going to promote
+(as a copy on another dir):
+
+  $ mkdir -p deep/a/
+  $ touch deep/a/deep_file
+  $ touch deep/base_file
+
+Let's try this:
+
+  $ dune build deep_copied
+
+This one works. Now, let's add a layer between base_file and deep_file:
+
+  $ rm -rf deep
+  $ mkdir -p deep/a/b/
+  $ touch deep/a/b/deep_file
+  $ touch deep/base_file
+
+  $ dune build deep_copied
+
+It now works!