Skip to content

Commit 6d9c684

Browse files
improve --parent-id cram test
1 parent db2d707 commit 6d9c684

File tree

4 files changed

+23
-49
lines changed

4 files changed

+23
-49
lines changed

test/pages/parent_ids.t/index.mld

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1 @@
11
{0 Index page}
2-
Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1 @@
11
{0 Package page}
2-

test/pages/parent_ids.t/run.t

Lines changed: 23 additions & 46 deletions
Original file line numberDiff line numberDiff line change
@@ -2,54 +2,26 @@ We make a 'package' mld file:
22

33
$ cat package.mld
44
{0 Package page}
5-
6-
7-
8-
9-
10-
11-
12-
13-
14-
15-
16-
17-
18-
19-
20-
215

226
And we'll have a module that we'll put underneath this package page.
237

248
$ cat test.mli
259
type t
26-
27-
28-
29-
30-
31-
32-
33-
34-
35-
36-
37-
38-
39-
40-
41-
42-
4310

4411
$ ocamlc -c -bin-annot test.mli
4512

4613
$ odoc compile test.cmti -I . --parent-id package --output-dir .
4714

15+
We do not check that directory given by --parent-id are indeed directories and
16+
not for instance modules
17+
Here, it is possible to do
18+
$ odoc compile index.mld --parent-id package/Test --output-dir .
19+
without triggering an error, even though this is a conflict where one of the
20+
package/Test/index.html page is overwritten silently.
21+
4822
$ odoc compile package.mld --parent-id package --output-dir .
4923
$ odoc compile index.mld --parent-id package --output-dir .
50-
$ odoc compile test_page.mld --parent-id package/Test --output-dir .
51-
52-
24+
$ odoc compile test_page.mld --parent-id package/foo --output-dir .
5325

5426
Link and generate the HTML:
5527

@@ -61,11 +33,11 @@ Link and generate the HTML:
6133
test.cmti
6234
test.mli
6335
test_page.mld
64-
$ ls package
65-
Test
66-
page-index.odoc
67-
page-package.odoc
68-
test.odoc
36+
$ find package -type f | sort
37+
package/foo/page-test_page.odoc
38+
package/page-index.odoc
39+
package/page-package.odoc
40+
package/test.odoc
6941
$ for i in $(find . -name *.odoc); do odoc link -I . $i; done
7042
$ for i in $(find . -name *.odocl); do odoc html-generate $i -o html; done
7143

@@ -74,18 +46,23 @@ file 'package.mld' should be written to the file 'package/index.html'.
7446

7547
$ find html -type f | sort
7648
html/package/Test/index.html
77-
html/package/Test/test_page.html
49+
html/package/foo/test_page.html
7850
html/package/index.html
7951
html/package/package.html
8052

8153
Let's make sure the manpage and latex renderers work too
8254

83-
$ for i in $(find . --name *.odocl); do odoc man-generate $i -o man; odoc latex-generate $i -o latex; done
84-
find: unknown predicate `--name'
55+
$ for i in $(find . -name *.odocl); do odoc man-generate $i -o man; odoc latex-generate $i -o latex; done
8556

8657
$ find man -type f | sort
87-
find: 'man': No such file or directory
58+
man/package/Test.3o
59+
man/package/foo/test_page.3o
60+
man/package/index.3o
61+
man/package/package.3o
8862

8963
$ find latex -type f | sort
90-
find: 'latex': No such file or directory
64+
latex/package/Test.tex
65+
latex/package/foo/test_page.tex
66+
latex/package/index.tex
67+
latex/package/package.tex
9168

test/pages/parent_ids.t/test.mli

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1 @@
11
type t
2-

0 commit comments

Comments
 (0)