-
Notifications
You must be signed in to change notification settings - Fork 233
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Test cases for label comment documentation (#1526)
from mheiber/more-label-comment-examples
- Loading branch information
Showing
2 changed files
with
67 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,66 @@ | ||
Examples adapted from https://v2.ocaml.org/manual/doccomments.html#ss:label-comments. | ||
We do not currently show these comments: | ||
|
||
$ cat >main.ml <<EOF | ||
> type t1 = | ||
> lbl_a:unit (** lbl_a comment *) -> | ||
> lbl_b:unit (** lbl_b comment *) -> unit | ||
> let _test (f: t1) = | ||
> let _ = f ~lbl_a:() ~lbl_b:() in | ||
> () | ||
> EOF | ||
|
||
FIXME: expected "lbl_b comment" | ||
|
||
$ $MERLIN single document -position 5:15 \ | ||
> -filename main.ml <main.ml | jq '.value' | ||
"Not a valid identifier" | ||
|
||
$ cat >main.ml <<EOF | ||
> type t = < | ||
> meth_a: unit; (** meth_a comment *) | ||
> meth_b: unit; (** meth_b comment *) | ||
> > | ||
> let _test (o: t3) = | ||
> o#meth_b | ||
> EOF | ||
|
||
FIXME: expected "meth_b comment" | ||
|
||
$ $MERLIN single document -position 6:6 \ | ||
> -filename main.ml <main.ml | jq '.value' | ||
"Not in environment 'meth_b'" | ||
|
||
$ cat >main.ml <<"EOF" | ||
> type t = [ | ||
> | `Poly_a (** Poly_a comment *) | ||
> | `Poly_b (** Poly_b comment *) | ||
> ] | ||
> let _: t4 = | ||
> `Poly_b | ||
> EOF | ||
|
||
FIXME: expected "Poly_b comment" | ||
|
||
$ $MERLIN single document -position 6:4 \ | ||
> -filename main.ml <main.ml | jq '.value' | ||
"Not a valid identifier" | ||
|
||
FIXME: expected "fld_b comment" | ||
|
||
$ cat >main.ml <<EOF | ||
> type t2 = { | ||
> fld_a: unit; (** fld_a comment *) | ||
> fld_b: unit; (** fld_b comment *) | ||
> fld_c: unit; | ||
> } | ||
> let _ = { | ||
> fld_a = (); | ||
> fld_b = (); | ||
> fld_c = () | ||
> } | ||
> EOF | ||
|
||
$ $MERLIN single document -position 8:4 \ | ||
> -filename main.ml <main.ml | jq '.value' | ||
"fld_a comment" |