File: run.t

package info (click to toggle)
ocaml-odoc 2.1.1%2Bdfsg-2
  • links: PTS, VCS
  • area: main
  • in suites: bookworm
  • size: 6,744 kB
  • sloc: ml: 37,049; makefile: 124; sh: 79
file content (34 lines) | stat: -rw-r--r-- 907 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
Check that we strengthen even the modules introduced in an include

  $ cat test.mli
  module type X = sig
    module Y : sig
      type t
    end
  end
  
  module Z : sig
    include X
  end
  
  module ZZ : sig
    include module type of struct include Z end
  end
  

In this example, module ZZ includes the strengthened contents of
Z. If the contents of the include in Z weren't strengthened, we would
end up with module Y in ZZ which would be unrelated do the Y in Z,
which is incorrect. Instead, we should end up with an alias in ZZ.
We can check this by looking for the expansion of Y in ZZ - if
the file 'html/x/Test/ZZ/Y/index.html' is there then the module has
_not_ been strengthened.

  $ ocamlc -bin-annot -c test.mli
  $ odoc compile --package x test.cmti
  $ odoc link test.odoc
  $ odoc html-generate test.odocl -o html
  $ find html/x/Test/ZZ
  html/x/Test/ZZ
  html/x/Test/ZZ/index.html