Skip to content

Commit e9def45

Browse files
committed
Add test for IDs for search entries of standalone comments
Exhibit a bug! Signed-off-by: Paul-Elliot <peada@free.fr>
1 parent 9624fc1 commit e9def45

File tree

2 files changed

+31
-0
lines changed

2 files changed

+31
-0
lines changed
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
let _ = 1
2+
3+
(** standalone 1 *)
4+
5+
module X = struct
6+
let _ = 1
7+
8+
(** standalone 2 *)
9+
end
10+
11+
(** standalone 3 *)
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
Compile the files
2+
3+
$ ocamlc -c main.ml -bin-annot -I .
4+
5+
Compile and link the documentation
6+
7+
$ odoc compile -I . main.cmt
8+
$ odoc link -I . main.odoc
9+
10+
$ odoc compile-index main.odocl
11+
12+
Let's have a look at the links generated for standalone comments search entries:
13+
14+
$ cat index.json | jq -r '.[] | select(.kind.kind | contains("Doc")) | "\(.doc) -> \(.display.url)"'
15+
standalone 1 -> Main/index.html
16+
standalone 2 -> Main/X/index.html
17+
standalone 3 -> Main/X/index.html
18+
19+
There is a problem with "standalone 3": it should link to Main/index.html, not Main/X/index.html
20+
This is a bug!

0 commit comments

Comments
 (0)