Skip to content

Commit c29c5ba

Browse files
committed
Add test
1 parent 6234406 commit c29c5ba

File tree

3 files changed

+34
-0
lines changed

3 files changed

+34
-0
lines changed
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
(rule
2+
(targets test.jpynb)
3+
(deps
4+
(:x test.md)
5+
(package mdx))
6+
(action
7+
(with-stdout-to
8+
%{targets}
9+
(run %{bin:ocaml-mdx} jupyter %{x}))))
10+
11+
(rule
12+
(alias runtest)
13+
(deps
14+
(:x test.jpynb)
15+
(:y test.jpynb.expected))
16+
(action
17+
(diff? %{y} %{x})))
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
{"metadata":{"kernelspec":{"display_name":"OCaml 4.07.1","language":"OCaml","name":"ocaml-jupyter"},"language_info":{"name":"OCaml","version":"4.07.1","codemirror_mode":"text/x-ocaml","file_extension":".ml","mimetype":"text/x-ocaml","nbconverter_exporter":null,"pygments_lexer":"OCaml"}},"nbformat":4,"nbformat_minor":2,"cells":[{"cell_type":"markdown","metadata":{},"source":"## Generating a Jupyter notebook\n\n\n"},{"cell_type":"code","metadata":{},"source":"let x = 1\nlet () = assert true","outputs":[],"execution_count":1},{"cell_type":"markdown","metadata":{},"source":"\nThis block should not be executed by the tests:"},{"cell_type":"code","metadata":{},"source":"let x = 2\nlet () = assert false (* Don't print this! *)","outputs":[],"execution_count":2},{"cell_type":"code","metadata":{},"source":"let () = print_int x","outputs":[],"execution_count":3}]}
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
## Generating a Jupyter notebook
2+
3+
```ocaml
4+
let x = 1
5+
let () = assert true
6+
```
7+
8+
This block should not be executed by the tests:
9+
```ocaml skip
10+
let x = 2
11+
let () = assert false (* Don't print this! *)
12+
```
13+
14+
```ocaml
15+
let () = print_int x
16+
```

0 commit comments

Comments
 (0)