Skip to content

Commit

Permalink
Add a minimalist test case for the os_type label
Browse files Browse the repository at this point in the history
  • Loading branch information
polytypic committed Aug 21, 2023
1 parent e589c07 commit 146b744
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 0 deletions.
12 changes: 12 additions & 0 deletions test/bin/mdx-test/expect/dune.inc
Original file line number Diff line number Diff line change
Expand Up @@ -371,6 +371,18 @@
(alias runtest)
(action (diff ocaml-errors-ellipsis/test-case.md ocaml-errors-ellipsis.actual)))

(rule
(target os_type.actual)
(deps (package mdx) (source_tree os_type))
(action
(with-stdout-to %{target}
(chdir os_type
(run ocaml-mdx test --output - test-case.md)))))

(rule
(alias runtest)
(action (diff os_type/test-case.md os_type.actual)))

(rule
(target padding.actual)
(deps (package mdx) (source_tree padding))
Expand Down
13 changes: 13 additions & 0 deletions test/bin/mdx-test/expect/os_type/test-case.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
Mdx can skip blocks based on `os_type`:

```ocaml os_type<>Win32
# #require "unix"
# Unix.nice 0
- : int = 0
```

```ocaml os_type=Win32
# #require "unix"
# Unix.nice 0
Exception: Invalid_argument "Unix.nice not implemented".
```

0 comments on commit 146b744

Please sign in to comment.