Skip to content

Commit dfe7a98

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

File tree

2 files changed

+41
-0
lines changed

2 files changed

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

0 commit comments

Comments
 (0)