Skip to content

Commit

Permalink
add test for new combination of flags
Browse files Browse the repository at this point in the history
  • Loading branch information
EmileTrotignon committed May 21, 2024
1 parent b636f8e commit 5479749
Showing 1 changed file with 26 additions and 4 deletions.
30 changes: 26 additions & 4 deletions test/pages/errors.t/run.t
Original file line number Diff line number Diff line change
Expand Up @@ -7,28 +7,50 @@ Let's check for expected errors.
We need to match parents with children
$ odoc compile -c dummy top1.mld
$ odoc compile -I . --parent top1 sub1.mld
ERROR: Specified parent is not a parent of this file
[1]

This is a different code-path:
$ odoc compile top1.mld --child foo
$ odoc compile -I . --parent top1 sub1.mld
ERROR: Specified parent is not a parent of this file
[1]

And these need to specify compilation unit children as well as mld children
$ ocamlc -c -bin-annot m1.mli
$ odoc compile m1.cmti -I . --parent top1
ERROR: File "m1.cmti":
Specified parent is not a parent of this file
ERROR: Specified parent is not a parent of this file
[1]

Parents must be pages
$ odoc compile top1.mld --child M1
$ odoc compile m1.cmti -I . --parent top1
ERROR: Specified parent is not a parent of this file
[1]
$ odoc compile sub1.mld -I . --parent module-M1
ERROR: Expecting page as parent
[1]

Linking checks the children are all present:
$ odoc compile top1.mld --child foo
$ odoc link page-top1.odoc -I .
File "page-top1.odoc":
Warning: Failed to lookup child page foo

$ odoc compile --parent bla --parent-id blabla m1.mli
Either --parent or --parent-id should be specified, not both.
[2]
$ odoc compile --parent bla --package blabla m1.mli
Either --package or --parent should be specified, not both.
[2]
$ odoc compile --package bla --child foo -- m1.mli
--child can only be passed with --parent.
[2]
$ odoc compile --parent-id bla --child foo -- m1.mli
--child can only be passed with --parent.
[2]
$ odoc compile --package bla --output-dir foo -- m1.mli
--output-dir can only be passed with --parent-id.
[2]
$ odoc compile --parent bla --output-dir foo -- m1.mli
--output-dir can only be passed with --parent-id.
[2]

0 comments on commit 5479749

Please sign in to comment.