Debian Codegraph @

test/blackbox-tests/test-cases/stanzas/mdx-stanza/mdx-prelude-runtime-deps-github7077.t

raw
1 When mdx is used to generate a program, the program will read the preludes at
2 run time. This test makes sure that this is recorded as a dependency.
3
4 $ cat > dune << EOF
5 > (mdx (preludes prelude.ml))
6 > EOF
7
8 $ cat > dune-project << EOF
9 > (lang dune 3.6)
10 > (using mdx 0.3)
11 > EOF
12
13 $ cat > prelude.ml << EOF
14 > let foo () = 1
15 > EOF
16
17 $ cat > README.md << 'EOF'
18 > ```ocaml
19 > # foo ();;
20 > - : int = 1
21 > ```
22 > EOF
23
24 $ dune runtest
25
26 $ echo 'let foo () = 2' > prelude.ml
27
28 $ dune runtest --auto-promote
29 File "README.md", line 1, characters 0-0:
30 --- README.md
31 +++ .mdx/README.md.corrected
32 @@ -1,4 +1,4 @@
33 ```ocaml
34 # foo ();;
35 -- : int = 1
36 +- : int = 2
37 ```
38 Promoting _build/default/.mdx/README.md.corrected to README.md.
39 [1]
40
41 $ cat README.md
42 ```ocaml
43 # foo ();;
44 - : int = 2
45 ```