Skip to content

Commit

Permalink
Update tests
Browse files Browse the repository at this point in the history
  • Loading branch information
Julow committed Mar 27, 2019
1 parent e65b6e3 commit d2be771
Show file tree
Hide file tree
Showing 5 changed files with 106 additions and 50 deletions.
24 changes: 12 additions & 12 deletions test/passing/doc_comments.ml.ref
Original file line number Diff line number Diff line change
Expand Up @@ -29,23 +29,23 @@ and y = 2

(** {1:lbl Heading} *)

(** {2 heading without label} *)
(** {2:heading-without-label heading without label} *)

module A = struct
module B = struct
(** It does not try to saturate
(2) A = B + C /\ B = D + E => A = C + D + E
Nor combine more than 2 equations
(3) A = B + C /\ B = D + E /\ F = C + D + E => A = F

xxxxxxxxxxxxxxxxxxxxxxxxxxx
(2) A = B + C /\ B = D + E => A = C + D - E
*)
(** It does not try to saturate (2) A = B + C /\ B = D + E => A = C + D
\+ E Nor combine more than 2 equations (3) A = B + C /\ B = D + E /\
F = C + D + E => A = F

xxxxxxxxxxxxxxxxxxxxxxxxxxx (2) A = B + C /\ B = D + E => A = C + D
\- E *)
let a b = ()
end
end

(* Same with get_pure, except that when we have both "x = t" and "y = t" where t is a primed ident,
* we add "x = y" to the result. This is crucial for the normalizer, as it tend to drop "x = t" before
* processing "y = t". If we don't explicitly preserve "x = y", the normalizer cannot pick it up *)
(* Same with get_pure, except that when we have both "x = t" and "y = t"
where t is a primed ident, * we add "x = y" to the result. This is
crucial for the normalizer, as it tend to drop "x = t" before *
processing "y = t". If we don't explicitly preserve "x = y", the
normalizer cannot pick it up *)
let _ = ()
64 changes: 45 additions & 19 deletions test/passing/doc_comments.mli
Original file line number Diff line number Diff line change
Expand Up @@ -13,23 +13,25 @@ val escape : string -> string

type title = string * int * string * string * string

(** {1 Standard section names} *)
(** {1:standard-section-names Standard section names} *)

val s_name : string

(** {1 Section maps} Used for handling the merging of metadata doc strings. *)
(** {1:section-maps Section maps}
Used for handling the merging of metadata doc strings. *)

type smap

val smap_append_block : smap -> sec:string -> block -> smap
(** [smap_append_block smap sec b] appends [b] at the end of section [sec]
creating it at the right place if needed. *)

(** {1 Content boilerplate} *)
(** {1:content-boilerplate Content boilerplate} *)

val s_environment_intro : block

(** {1 Output} *)
(** {1:output Output} *)

type format = [`Auto | `Pager | `Plain | `Groff]

Expand All @@ -41,7 +43,8 @@ val print :
-> t
-> unit

(** {1 Printers and escapes used by Cmdliner module} *)
(** {1:printers-and-escapes-used-by-cmdliner-module Printers and escapes
used by Cmdliner module} *)

val subst_vars :
errs:Format.formatter
Expand All @@ -52,6 +55,7 @@ val subst_vars :
(** [subst b ~subst s], using [b], substitutes in [s] variables of the form
"$(doc)" by their [subst] definition. This leaves escapes and markup
directives $(markup,...) intact.
@raise Invalid_argument in case of illegal syntax. *)

val doc_to_plain :
Expand All @@ -62,24 +66,37 @@ val doc_to_plain :
-> string
(** [doc_to_plain b ~subst s] using [b], subsitutes in [s] variables by
their [subst] definition and renders cmdliner directives to plain text.
@raise Invalid_argument in case of illegal syntax. *)

val k : k
(** this is a comment
@author foo
@version foo
@see <foo> foo
@since foo
@before foo [foo]
@deprecated [foo]
@param foo [foo]
@raise foo [foo]
@return [foo]
@inline
@canonical foo *)

val x : x
(** a comment
@version foo *)

(** Managing Chunks.
Expand Down Expand Up @@ -123,9 +140,9 @@ val x : x
This is preformated code:
{[
let verbatim s =
s |> String.split_lines |> List.map ~f:String.strip
|> fun s -> list s "@," Fmt.str
let verbatim s =
s |> String.split_lines |> List.map ~f:String.strip
|> fun s -> list s "@," Fmt.str
]} *)

(** Lists:
Expand Down Expand Up @@ -158,13 +175,17 @@ val x : x
{ul
{- xxx
- a
- b
- c}
- c
}
{- yyy
+ a
+ b
+ c}} *)
+ c
}} *)

(** {{:https://github.com/} Github} *)

Expand All @@ -180,7 +201,7 @@ val x : x

(** [a]'c [b]'s [c]'c *)

(** return true if {%\gamma(lhs) \subseteq \gamma(rhs)%} *)
(** return true if [\gamma(lhs) \subseteq \gamma(rhs)] *)

(** Composition of functions: [(f >> g) x] is exactly equivalent to
[g (f (x))]. Left associative. *)
Expand All @@ -189,7 +210,7 @@ val x : x

(** for [Global]s *)

(** generic command: ∀xs.{foot}-{post} *)
(** generic command: ∀xs.[foot]-[post] *)

(** [\[ \] \[\] \]] *)

Expand All @@ -214,20 +235,25 @@ b
(** {ul
{- Abc
Def}
{- Hij}
Def
}
{- Hij
}
{- Klm
{ul
{- Nop
{ul
{- Nop
Qrs}
{- Tuv}}}} *)
Qrs
}
{- Tuv
}}
}} *)

(** - {v
Abc
def
v}
v}
- {[
A
B
Expand Down
64 changes: 45 additions & 19 deletions test/passing/doc_comments.mli.ref
Original file line number Diff line number Diff line change
Expand Up @@ -13,23 +13,25 @@ val escape : string -> string

type title = string * int * string * string * string

(** {1 Standard section names} *)
(** {1:standard-section-names Standard section names} *)

val s_name : string

(** {1 Section maps} Used for handling the merging of metadata doc strings. *)
(** {1:section-maps Section maps}

Used for handling the merging of metadata doc strings. *)

type smap

val smap_append_block : smap -> sec:string -> block -> smap
(** [smap_append_block smap sec b] appends [b] at the end of section [sec]
creating it at the right place if needed. *)

(** {1 Content boilerplate} *)
(** {1:content-boilerplate Content boilerplate} *)

val s_environment_intro : block

(** {1 Output} *)
(** {1:output Output} *)

type format = [`Auto | `Pager | `Plain | `Groff]

Expand All @@ -41,7 +43,8 @@ val print :
-> t
-> unit

(** {1 Printers and escapes used by Cmdliner module} *)
(** {1:printers-and-escapes-used-by-cmdliner-module Printers and escapes
used by Cmdliner module} *)

val subst_vars :
errs:Format.formatter
Expand All @@ -52,6 +55,7 @@ val subst_vars :
(** [subst b ~subst s], using [b], substitutes in [s] variables of the form
"$(doc)" by their [subst] definition. This leaves escapes and markup
directives $(markup,...) intact.

@raise Invalid_argument in case of illegal syntax. *)

val doc_to_plain :
Expand All @@ -62,24 +66,37 @@ val doc_to_plain :
-> string
(** [doc_to_plain b ~subst s] using [b], subsitutes in [s] variables by
their [subst] definition and renders cmdliner directives to plain text.

@raise Invalid_argument in case of illegal syntax. *)

val k : k
(** this is a comment

@author foo

@version foo

@see <foo> foo

@since foo

@before foo [foo]

@deprecated [foo]

@param foo [foo]

@raise foo [foo]

@return [foo]

@inline

@canonical foo *)

val x : x
(** a comment

@version foo *)

(** Managing Chunks.
Expand Down Expand Up @@ -123,9 +140,9 @@ val x : x
This is preformated code:

{[
let verbatim s =
s |> String.split_lines |> List.map ~f:String.strip
|> fun s -> list s "@," Fmt.str
let verbatim s =
s |> String.split_lines |> List.map ~f:String.strip
|> fun s -> list s "@," Fmt.str
]} *)

(** Lists:
Expand Down Expand Up @@ -158,13 +175,17 @@ val x : x

{ul
{- xxx

- a
- b
- c}
- c
}
{- yyy

+ a
+ b
+ c}} *)
+ c
}} *)

(** {{:https://github.com/} Github} *)

Expand All @@ -180,7 +201,7 @@ val x : x

(** [a]'c [b]'s [c]'c *)

(** return true if {%\gamma(lhs) \subseteq \gamma(rhs)%} *)
(** return true if [\gamma(lhs) \subseteq \gamma(rhs)] *)

(** Composition of functions: [(f >> g) x] is exactly equivalent to
[g (f (x))]. Left associative. *)
Expand All @@ -189,7 +210,7 @@ val x : x

(** for [Global]s *)

(** generic command: ∀xs.{foot}-{post} *)
(** generic command: ∀xs.[foot]-[post] *)

(** [\[ \] \[\] \]] *)

Expand All @@ -214,20 +235,25 @@ b
(** {ul
{- Abc

Def}
{- Hij}
Def
}
{- Hij
}
{- Klm

{ul
{- Nop
{ul
{- Nop

Qrs}
{- Tuv}}}} *)
Qrs
}
{- Tuv
}}
}} *)

(** - {v
Abc
def
v}
v}
- {[
A
B
Expand Down
2 changes: 2 additions & 0 deletions test/passing/tag_only.ml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
open Module

(** abc
@deprecated *)
open Module

Expand Down Expand Up @@ -74,6 +75,7 @@ module A = Module.With_very_loooooooooooooooooooooooong_naaaaaaaaaaaaaaaaame
open Module (** @deprecated *)

(** abc
@deprecated *)
open Module

Expand Down
Loading

0 comments on commit d2be771

Please sign in to comment.