Skip to content

Commit

Permalink
test: Reproduction for #1173
Browse files Browse the repository at this point in the history
  • Loading branch information
Julow authored and jonludlam committed Sep 13, 2024
1 parent 6854913 commit 14da78f
Show file tree
Hide file tree
Showing 4 changed files with 34 additions and 0 deletions.
2 changes: 2 additions & 0 deletions test/generators/cases/bugs.ml
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,5 @@ let foo (type a) ?(bar : a opt) () = ()
(** Triggers an assertion failure when
{:https://github.com/ocaml/odoc/issues/101} is not fixed. *)

let repeat x y = (x, y, x, y)
(** Renders as [val repeat : 'a -> 'b -> 'c * 'd * 'e * 'f] before https://github.com/ocaml/odoc/pull/1173 *)
23 changes: 23 additions & 0 deletions test/generators/html/Bugs.html
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,29 @@ <h1>Module <code><span>Bugs</span></code></h1>
</p>
</div>
</div>
<div class="odoc-spec">
<div class="spec value anchored" id="val-repeat">
<a href="#val-repeat" class="anchor"></a>
<code>
<span><span class="keyword">val</span> repeat :
<span><span class="type-var">'a</span>
<span class="arrow">&#45;&gt;</span>
</span>
<span><span class="type-var">'b</span>
<span class="arrow">&#45;&gt;</span>
</span> <span class="type-var">'c</span> *
<span class="type-var">'d</span> * <span class="type-var">'e</span>
* <span class="type-var">'f</span>
</span>
</code>
</div>
<div class="spec-doc">
<p>Renders as
<code>val repeat : 'a -&gt; 'b -&gt; 'c * 'd * 'e * 'f</code> before
https://github.com/ocaml/odoc/pull/1173
</p>
</div>
</div>
</div>
</body>
</html>
2 changes: 2 additions & 0 deletions test/generators/latex/Bugs.tex
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,7 @@ \section{Module \ocamlinlinecode{Bugs}}\label{module-Bugs}%
\label{module-Bugs-type-opt}\ocamlcodefragment{\ocamltag{keyword}{type} 'a opt = \ocamltag{type-var}{'a} option}\\
\label{module-Bugs-val-foo}\ocamlcodefragment{\ocamltag{keyword}{val} foo : \ocamltag{optlabel}{?bar}:\ocamltag{type-var}{'a} \ocamltag{arrow}{$\rightarrow$} unit \ocamltag{arrow}{$\rightarrow$} unit}\begin{ocamlindent}Triggers an assertion failure when \href{https://github.com/ocaml/odoc/issues/101}{https://github.com/ocaml/odoc/issues/101}\footnote{\url{https://github.com/ocaml/odoc/issues/101}} is not fixed.\end{ocamlindent}%
\medbreak
\label{module-Bugs-val-repeat}\ocamlcodefragment{\ocamltag{keyword}{val} repeat : \ocamltag{type-var}{'a} \ocamltag{arrow}{$\rightarrow$} \ocamltag{type-var}{'b} \ocamltag{arrow}{$\rightarrow$} \ocamltag{type-var}{'c} * \ocamltag{type-var}{'d} * \ocamltag{type-var}{'e} * \ocamltag{type-var}{'f}}\begin{ocamlindent}Renders as \ocamlinlinecode{val repeat : 'a -> 'b -> 'c * 'd * 'e * 'f} before https://github.com/ocaml/odoc/pull/1173\end{ocamlindent}%
\medbreak


7 changes: 7 additions & 0 deletions test/generators/man/Bugs.3o
Original file line number Diff line number Diff line change
Expand Up @@ -23,4 +23,11 @@ https://github\.com/ocaml/odoc/issues/101
.UE
is not fixed\.
.nf
.sp
\f[CB]val\fR repeat : \f[CB]'a\fR \f[CB]\->\fR \f[CB]'b\fR \f[CB]\->\fR \f[CB]'c\fR * \f[CB]'d\fR * \f[CB]'e\fR * \f[CB]'f\fR
.fi
.br
.ti +2
Renders as val repeat : 'a -> 'b -> 'c * 'd * 'e * 'f before https://github\.com/ocaml/odoc/pull/1173
.nf

0 comments on commit 14da78f

Please sign in to comment.