Skip to content

Commit

Permalink
promote tests
Browse files Browse the repository at this point in the history
  • Loading branch information
lubegasimon committed Feb 10, 2022
1 parent 7d0c982 commit 4f9a548
Show file tree
Hide file tree
Showing 44 changed files with 281 additions and 142 deletions.
3 changes: 2 additions & 1 deletion test/generators/markdown/Alias.X.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,5 @@ Module `Alias.X`

> int
Module Foo__X documentation. This should appear in the documentation for the alias to this module 'X'
Module Foo__X documentation. This should appear in the documentation for the
alias to this module 'X'
4 changes: 3 additions & 1 deletion test/generators/markdown/Bugs.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,4 +14,6 @@ Module `Bugs`

> ?bar:'a -> unit -> unit
Triggers an assertion failure when [https://github.com/ocaml/odoc/issues/101](https://github.com/ocaml/odoc/issues/101) is not fixed.
Triggers an assertion failure when
[https://github.com/ocaml/odoc/issues/101](https://github.com/ocaml/odoc/issues/101)
is not fixed.
3 changes: 2 additions & 1 deletion test/generators/markdown/Bugs_post_406.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@ Bugs_post_406

Module `Bugs_post_406`

Let-open in class types, https://github.com/ocaml/odoc/issues/543 This was added to the language in 4.06
Let-open in class types, https://github.com/ocaml/odoc/issues/543 This was
added to the language in 4.06

<a id="class-type-let_open"></a>

Expand Down
12 changes: 8 additions & 4 deletions test/generators/markdown/Include.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,13 +20,16 @@ Module `Include`

<a id="module-type-Not_inlined_and_closed"></a>

###### module type [Not_inlined_and_closed](Include.module-type-Not_inlined_and_closed.md)
###### module type
[Not_inlined_and_closed](Include.module-type-Not_inlined_and_closed.md)

include [Not_inlined_and_closed](Include.module-type-Not_inlined_and_closed.md)
include
[Not_inlined_and_closed](Include.module-type-Not_inlined_and_closed.md)

<a id="module-type-Not_inlined_and_opened"></a>

###### module type [Not_inlined_and_opened](Include.module-type-Not_inlined_and_opened.md)
###### module type
[Not_inlined_and_opened](Include.module-type-Not_inlined_and_opened.md)

<a id="type-w"></a>

Expand All @@ -38,7 +41,8 @@ include [Not_inlined_and_closed](Include.module-type-Not_inlined_and_closed.md)

<a id="module-type-Dorminant_Module"></a>

###### module type [Dorminant_Module](Include.module-type-Dorminant_Module.md)
###### module type
[Dorminant_Module](Include.module-type-Dorminant_Module.md)

<a id="val-a"></a>

Expand Down
3 changes: 2 additions & 1 deletion test/generators/markdown/Include2.Y_include_synopsis.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@ Y_include_synopsis

Module `Include2.Y_include_synopsis`

The `include Y` below should have the synopsis from `Y`'s top-comment attached to it.
The `include Y` below should have the synopsis from `Y`'s top-comment
attached to it.

<a id="type-t"></a>

Expand Down
3 changes: 2 additions & 1 deletion test/generators/markdown/Include2.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,8 @@ Top-comment of Y.

###### module [Y_include_synopsis](Include2.Y_include_synopsis.md)

The `include Y` below should have the synopsis from `Y`'s top-comment attached to it.
The `include Y` below should have the synopsis from `Y`'s top-comment
attached to it.

<a id="module-Y_include_doc"></a>

Expand Down
6 changes: 4 additions & 2 deletions test/generators/markdown/Include_sections.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,8 @@ Some text.

# Second include

Let's include [`Something`](Include_sections.module-type-Something.md) a second time: the heading level should be shift here.
Let's include [`Something`](Include_sections.module-type-Something.md) a
second time: the heading level should be shift here.

# Something 1

Expand All @@ -48,7 +49,8 @@ foo

Some text.

And let's include it again, but without inlining it this time: the ToC shouldn't grow.
And let's include it again, but without inlining it this time: the ToC
shouldn't grow.

<a id="val-something"></a>

Expand Down
2 changes: 1 addition & 1 deletion test/generators/markdown/Labels.md
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ Attached to constructor

<a id="type-v"></a>

###### type v = {
###### type v =

<a id="type-v.f"></a>

Expand Down
53 changes: 41 additions & 12 deletions test/generators/markdown/Markup.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,8 @@ Here, we test the rendering of comment markup.

# Sections

Let's get these done first, because sections will be used to break up the rest of this test.
Let's get these done first, because sections will be used to break up the
rest of this test.

Besides the section heading above, there are also

Expand All @@ -16,39 +17,65 @@ and

### Sub-subsection headings

but odoc has banned deeper headings. There are also title headings, but they are only allowed in mld files.
but odoc has banned deeper headings. There are also title headings, but they
are only allowed in mld files.

### Anchors

Sections can have attached [Anchors](#anchors), and it is possible to [link](#anchors) to them. Links to section headers should not be set in source code style.
Sections can have attached [Anchors](#anchors), and it is possible to
[link](#anchors) to them. Links to section headers should not be set in
source code style.

#### Paragraph

Individual paragraphs can have a heading.

##### Subparagraph

Parts of a longer paragraph that can be considered alone can also have headings.
Parts of a longer paragraph that can be considered alone can also have
headings.

# Styling

This paragraph has some styled elements: **bold** and _italic_, **_bold italic_**, _emphasis_, __emphasis_ within emphasis_, **_bold italic_**, super<sup>script</sup>, sub<sub>script</sub>. The line spacing should be enough for superscripts and subscripts not to look odd.
This paragraph has some styled elements: **bold** and _italic_, **_bold
italic_**, _emphasis_, __emphasis_ within emphasis_, **_bold italic_**,
super<sup>script</sup>, sub<sub>script</sub>. The line spacing should be
enough for superscripts and subscripts not to look odd.

Note: _In italics _emphasis_ is rendered as normal text while _emphasis _in_ emphasis_ is rendered in italics._ _It also work the same in [links in italics with _emphasis _in_ emphasis_.](#)_
Note: _In italics _emphasis_ is rendered as normal text while _emphasis _in_
emphasis_ is rendered in italics._ _It also work the same in [links in
italics with _emphasis _in_ emphasis_.](#)_

`code` is a different kind of markup that doesn't allow nested markup.

It's possible for two markup elements to appear **next** _to_ each other and have a space, and appear **next**_to_ each other with no space. It doesn't matter **how** _much_ space it was in the source: in this sentence, it was two space characters. And in this one, there is **a** _newline_.
It's possible for two markup elements to appear **next** _to_ each other and
have a space, and appear **next**_to_ each other with no space. It doesn't
matter **how** _much_ space it was in the source: in this sentence, it was
two space characters. And in this one, there is **a** _newline_.

This is also true between _non-_`code` markup _and_ `code`.

Code can appear **inside `other` markup**. Its display shouldn't be affected.

# Links and references

This is a [link](#). It sends you to the top of this page. Links can have markup inside them: [**bold**](#), [_italics_](#), [_emphasis_](#), [super<sup>script</sup>](#), [sub<sub>script</sub>](#), and [`code`](#). Links can also be nested _[inside](#)_ markup. Links cannot be nested inside each other. This link has no replacement text: [#](#). The text is filled in by odoc. This is a shorthand link: [#](#). The text is also filled in by odoc in this case.

This is a reference to [`foo`](#val-foo). References can have replacement text: [the value foo](#val-foo). Except for the special lookup support, references are pretty much just like links. The replacement text can have nested styles: [**bold**](#val-foo), [_italic_](#val-foo), [_emphasis_](#val-foo), [super<sup>script</sup>](#val-foo), [sub<sub>script</sub>](#val-foo), and [`code`](#val-foo). It's also possible to surround a reference in a style: **[`foo`](#val-foo)**. References can't be nested inside references, and links and references can't be nested inside each other.
This is a [link](#). It sends you to the top of this page. Links can have
markup inside them: [**bold**](#), [_italics_](#), [_emphasis_](#),
[super<sup>script</sup>](#), [sub<sub>script</sub>](#), and [`code`](#).
Links can also be nested _[inside](#)_ markup. Links cannot be nested inside
each other. This link has no replacement text: [#](#). The text is filled in
by odoc. This is a shorthand link: [#](#). The text is also filled in by odoc
in this case.

This is a reference to [`foo`](#val-foo). References can have replacement
text: [the value foo](#val-foo). Except for the special lookup support,
references are pretty much just like links. The replacement text can have
nested styles: [**bold**](#val-foo), [_italic_](#val-foo),
[_emphasis_](#val-foo), [super<sup>script</sup>](#val-foo),
[sub<sub>script</sub>](#val-foo), and [`code`](#val-foo). It's also possible
to surround a reference in a style: **[`foo`](#val-foo)**. References can't
be nested inside references, and links and references can't be nested inside
each other.

# Preformatted text

Expand Down Expand Up @@ -85,7 +112,8 @@ The main difference is these don't get syntax highlighting.
2. shorthand numbered list.


- Shorthand list items can span multiple lines, however trying to put two paragraphs into a shorthand list item using a double line break
- Shorthand list items can span multiple lines, however trying to put two
paragraphs into a shorthand list item using a double line break


just creates a paragraph outside the list.
Expand Down Expand Up @@ -126,7 +154,8 @@ The parser supports any ASCII-compatible encoding, in particuλar UTF-8.

# Raw HTML

Raw HTML can be <input type="text" placeholder="inserted"> as inline elements into sentences.
Raw HTML can be <input type="text" placeholder="inserted"> as inline elements
into sentences.


<blockquote>
Expand Down
4 changes: 3 additions & 1 deletion test/generators/markdown/Module.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,9 @@ Foo.

> unit
The module needs at least one signature item, otherwise a bug causes the compiler to drop the module comment (above). See [https://caml.inria.fr/mantis/view.php?id=7701](https://caml.inria.fr/mantis/view.php?id=7701).
The module needs at least one signature item, otherwise a bug causes the
compiler to drop the module comment (above). See
[https://caml.inria.fr/mantis/view.php?id=7701](https://caml.inria.fr/mantis/view.php?id=7701).

<a id="module-type-S"></a>

Expand Down
3 changes: 2 additions & 1 deletion test/generators/markdown/Nested.F.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ Some additional comments.

###### type t =

> [Arg1.t](Nested.F.argument-1-Arg1.md#type-t) * [Arg2.t](Nested.F.argument-2-Arg2.md#type-t)
> [Arg1.t](Nested.F.argument-1-Arg1.md#type-t)
> * [Arg2.t](Nested.F.argument-2-Arg2.md#type-t)
Some type.
6 changes: 4 additions & 2 deletions test/generators/markdown/Ocamlary.Aliases.md
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,8 @@ Let's imitate jst's layout.
### include of Foo

Just for giggle, let's see what happens when we include [`Foo`](Ocamlary.Aliases.Foo.md).
Just for giggle, let's see what happens when we include
[`Foo`](Ocamlary.Aliases.Foo.md).

<a id="module-A"></a>

Expand Down Expand Up @@ -92,7 +93,8 @@ Just for giggle, let's see what happens when we include [`Foo`](Ocamlary.Aliases

> [A.t](Ocamlary.Aliases.Foo.A.md#type-t)
And also, let's refer to [`A.t`](Ocamlary.Aliases.Foo.A.md#type-t) and [`Foo.B.id`](Ocamlary.Aliases.Foo.B.md#val-id)
And also, let's refer to [`A.t`](Ocamlary.Aliases.Foo.A.md#type-t) and
[`Foo.B.id`](Ocamlary.Aliases.Foo.B.md#val-id)

<a id="module-P1"></a>

Expand Down
6 changes: 4 additions & 2 deletions test/generators/markdown/Ocamlary.CanonicalTest.Base_Tests.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,13 +20,15 @@ Module `CanonicalTest.Base_Tests`

###### val foo :

> int [L.t](Ocamlary.CanonicalTest.Base.List.md#type-t) -> float [L.t](Ocamlary.CanonicalTest.Base.List.md#type-t)
> int [L.t](Ocamlary.CanonicalTest.Base.List.md#type-t) -> float
> [L.t](Ocamlary.CanonicalTest.Base.List.md#type-t)
<a id="val-bar"></a>

###### val bar :

> 'a [Base.List.t](Ocamlary.CanonicalTest.Base.List.md#type-t) -> 'a [Base.List.t](Ocamlary.CanonicalTest.Base.List.md#type-t)
> 'a [Base.List.t](Ocamlary.CanonicalTest.Base.List.md#type-t) -> 'a
> [Base.List.t](Ocamlary.CanonicalTest.Base.List.md#type-t)
<a id="val-baz"></a>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,12 +18,14 @@ This comment is for `t`.

<a id="module-InnerModuleA'"></a>

###### module [InnerModuleA'](Ocamlary.CollectionModule.InnerModuleA.InnerModuleA'.md)
###### module
[InnerModuleA'](Ocamlary.CollectionModule.InnerModuleA.InnerModuleA'.md)

This comment is for `InnerModuleA'`.

<a id="module-type-InnerModuleTypeA'"></a>

###### module type [InnerModuleTypeA'](Ocamlary.CollectionModule.InnerModuleA.module-type-InnerModuleTypeA'.md)
###### module type
[InnerModuleTypeA'](Ocamlary.CollectionModule.InnerModuleA.module-type-InnerModuleTypeA'.md)

This comment is for `InnerModuleTypeA'`.
Original file line number Diff line number Diff line change
Expand Up @@ -20,12 +20,14 @@ This comment is for `t`.

<a id="module-InnerModuleA'"></a>

###### module [InnerModuleA'](Ocamlary.FunctorTypeOf.argument-1-Collection.InnerModuleA.InnerModuleA'.md)
###### module
[InnerModuleA'](Ocamlary.FunctorTypeOf.argument-1-Collection.InnerModuleA.InnerModuleA'.md)

This comment is for `InnerModuleA'`.

<a id="module-type-InnerModuleTypeA'"></a>

###### module type [InnerModuleTypeA'](Ocamlary.FunctorTypeOf.argument-1-Collection.InnerModuleA.module-type-InnerModuleTypeA'.md)
###### module type
[InnerModuleTypeA'](Ocamlary.FunctorTypeOf.argument-1-Collection.InnerModuleA.module-type-InnerModuleTypeA'.md)

This comment is for `InnerModuleTypeA'`.
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,8 @@ This comment is for `collection`.

<a id="module-InnerModuleA"></a>

###### module [InnerModuleA](Ocamlary.FunctorTypeOf.argument-1-Collection.InnerModuleA.md)
###### module
[InnerModuleA](Ocamlary.FunctorTypeOf.argument-1-Collection.InnerModuleA.md)

This comment is for `InnerModuleA`.

Expand Down
6 changes: 4 additions & 2 deletions test/generators/markdown/Ocamlary.IncludeInclude1.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,10 @@ Module `Ocamlary.IncludeInclude1`

<a id="module-type-IncludeInclude2"></a>

###### module type [IncludeInclude2](Ocamlary.IncludeInclude1.module-type-IncludeInclude2.md)
###### module type
[IncludeInclude2](Ocamlary.IncludeInclude1.module-type-IncludeInclude2.md)

<a id="module-IncludeInclude2_M"></a>

###### module [IncludeInclude2_M](Ocamlary.IncludeInclude1.IncludeInclude2_M.md)
###### module
[IncludeInclude2_M](Ocamlary.IncludeInclude1.IncludeInclude2_M.md)
3 changes: 2 additions & 1 deletion test/generators/markdown/Ocamlary.ModuleWithSignature.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,5 @@ ModuleWithSignature

Module `Ocamlary.ModuleWithSignature`

A plain module of a signature of [`EmptySig`](Ocamlary.module-type-EmptySig.md) (reference)
A plain module of a signature of
[`EmptySig`](Ocamlary.module-type-EmptySig.md) (reference)
Original file line number Diff line number Diff line change
Expand Up @@ -18,12 +18,14 @@ This comment is for `t`.

<a id="module-InnerModuleA'"></a>

###### module [InnerModuleA'](Ocamlary.Recollection.InnerModuleA.InnerModuleA'.md)
###### module
[InnerModuleA'](Ocamlary.Recollection.InnerModuleA.InnerModuleA'.md)

This comment is for `InnerModuleA'`.

<a id="module-type-InnerModuleTypeA'"></a>

###### module type [InnerModuleTypeA'](Ocamlary.Recollection.InnerModuleA.module-type-InnerModuleTypeA'.md)
###### module type
[InnerModuleTypeA'](Ocamlary.Recollection.InnerModuleA.module-type-InnerModuleTypeA'.md)

This comment is for `InnerModuleTypeA'`.
Original file line number Diff line number Diff line change
Expand Up @@ -20,12 +20,14 @@ This comment is for `t`.

<a id="module-InnerModuleA'"></a>

###### module [InnerModuleA'](Ocamlary.Recollection.argument-1-C.InnerModuleA.InnerModuleA'.md)
###### module
[InnerModuleA'](Ocamlary.Recollection.argument-1-C.InnerModuleA.InnerModuleA'.md)

This comment is for `InnerModuleA'`.

<a id="module-type-InnerModuleTypeA'"></a>

###### module type [InnerModuleTypeA'](Ocamlary.Recollection.argument-1-C.InnerModuleA.module-type-InnerModuleTypeA'.md)
###### module type
[InnerModuleTypeA'](Ocamlary.Recollection.argument-1-C.InnerModuleA.module-type-InnerModuleTypeA'.md)

This comment is for `InnerModuleTypeA'`.
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,8 @@ This comment is for `collection`.

<a id="module-InnerModuleA"></a>

###### module [InnerModuleA](Ocamlary.Recollection.argument-1-C.InnerModuleA.md)
###### module
[InnerModuleA](Ocamlary.Recollection.argument-1-C.InnerModuleA.md)

This comment is for `InnerModuleA`.

Expand Down
Loading

0 comments on commit 4f9a548

Please sign in to comment.