Skip to content

Commit efe0f89

Browse files
committed
test: repro case for #8075
Signed-off-by: Ali Caglayan <[email protected]>
1 parent aa803cf commit efe0f89

File tree

2 files changed

+43
-0
lines changed

2 files changed

+43
-0
lines changed
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
(cram
2+
(applies_to symlink-to-nonexistent)
3+
(deps %{bin:git} ../git-helpers.sh))
Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
$ . ../git-helpers.sh
2+
3+
Tests for promoting with symlink to non-existent file.
4+
5+
$ cat > dune-project <<EOF
6+
> (lang dune 3.21)
7+
> EOF
8+
$ cp dune-project dune-workspace
9+
10+
$ cat > dune <<EOF
11+
> (rule
12+
> (with-stdout-to "x.gen"
13+
> (echo "toto")))
14+
> (rule
15+
> (alias bench)
16+
> (action
17+
> (diff promoted x.gen)))
18+
> EOF
19+
20+
Unset INSIDE_DUNE in order to choose the "git diff" diff algorithm. Root
21+
detection will now be automatic so a dune-workspace file was included above.
22+
$ unset INSIDE_DUNE
23+
24+
This should fail initially but not with the "Unable to resolve symlink" error.
25+
$ dune build @bench
26+
File "dune", lines 4-7, characters 0-55:
27+
4 | (rule
28+
5 | (alias bench)
29+
6 | (action
30+
7 | (diff promoted x.gen)))
31+
Error: Unable to resolve symlink _build/default/promoted
32+
[1]
33+
34+
Promotion should work
35+
$ dune promote
36+
Promoting _build/default/x.gen to promoted.
37+
38+
$ cat promoted
39+
toto
40+

0 commit comments

Comments
 (0)