Skip to content

Commit

Permalink
Test: cover empty parent id
Browse files Browse the repository at this point in the history
  • Loading branch information
panglesd committed Aug 21, 2024
1 parent 8f0f04e commit bc1b3e0
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 1 deletion.
7 changes: 6 additions & 1 deletion test/parent_id/dune
Original file line number Diff line number Diff line change
@@ -1,2 +1,7 @@
(env
(_
(binaries
(../odoc_print/odoc_print.exe as odoc_print))))

(cram
(deps %{bin:odoc}))
(deps %{bin:odoc} %{bin:odoc_print}))
15 changes: 15 additions & 0 deletions test/parent_id/empty_parent_id.t/run.t
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
$ echo "{0 Test}" > file.mld

It is possible to have pages with no parent, even with the odoc 3 "parent-id"
argument. In this case, an empty string is passed as argument.

$ odoc compile --parent-id "" --output-dir _odoc file.mld
$ ls _odoc
page-file.odoc
$ odoc_print _odoc/page-file.odoc | jq ".name"
{
"`LeafPage": [
"None",
"file"
]
}

0 comments on commit bc1b3e0

Please sign in to comment.