Debian Codegraph @

test/blackbox-tests/test-cases/stanzas/mdx-stanza/sandboxing.t

raw
1 Mdx tests run in a sandbox, so undeclared files are not visible.
2
3 $ cat > dune-project << EOF
4 > (lang dune 3.22)
5 > (using mdx 0.5)
6 > EOF
7
8 $ cat > dune << EOF
9 > (rule
10 > (target secret.txt)
11 > (action (with-stdout-to %{target} (echo "top secret"))))
12 >
13 > (mdx (files README.md))
14 > EOF
15
16 $ cat > README.md << 'EOF'
17 > ```sh
18 > $ [ -f secret.txt ] && cat secret.txt || echo "secret missing"
19 > ```
20 > EOF
21
22 $ dune build secret.txt
23 $ cat _build/default/secret.txt
24 top secret
25
26 $ dune runtest
27 File "README.md", line 1, characters 0-0:
28 --- README.md
29 +++ .mdx/README.md.corrected
30 @@ -1,3 +1,4 @@
31 ```sh
32 $ [ -f secret.txt ] && cat secret.txt || echo "secret missing"
33 +secret missing
34 ```
35 [1]
36
37 $ cat > dune-project << EOF
38 > (lang dune 3.22)
39 > (using mdx 0.4)
40 > EOF
41
42 $ dune runtest
43 File "README.md", line 1, characters 0-0:
44 --- README.md
45 +++ .mdx/README.md.corrected
46 @@ -1,3 +1,4 @@
47 ```sh
48 $ [ -f secret.txt ] && cat secret.txt || echo "secret missing"
49 +top secret
50 ```
51 [1]