Skip to content

Commit

Permalink
more tests
Browse files Browse the repository at this point in the history
  • Loading branch information
PizieDust committed Apr 4, 2024
1 parent 24c92c6 commit 0942b58
Showing 1 changed file with 71 additions and 3 deletions.
74 changes: 71 additions & 3 deletions tests/test-dirs/expand_node/ppx-tests.t/run.t
Original file line number Diff line number Diff line change
Expand Up @@ -390,7 +390,7 @@ Module type declaration in structure
Module type declaration in signature
$ cat > apc.mli << EOF
> module type Stack = sig
> type t
> type t [@@deriving rename]
> type stack
> val empty : stack
> val is_empty : stack -> bool
Expand All @@ -402,12 +402,74 @@ Module type declaration in signature

$ dune build

on keyword module
$ $MERLIN single expand-node -position 1:6 -filename ./apc.mli < ./apc.mli
{
"class": "return",
"value": "No PPX deriver/extension node found on this position",
"notifications": []
}

on attribute name deriving of type t
TODO: a cursor here should only output the derived t and now the whole module
$ $MERLIN single expand-node -position 2:14 -filename ./apc.mli < ./apc.mli
{
"class": "return",
"value": "[ module type Stack =
sig
type t[@@deriving rename]
include sig [@@@ocaml.warning \"-32\"] type t_renamed end[@@ocaml.doc
\"@inline\"]
[@@merlin.hide ]
type stack
val empty : stack
val is_empty : stack -> bool
val push : t -> stack -> stack
val pop : stack -> stack
val peek : stack -> t
end[@@deriving rename]
; include
sig
[@@@ocaml.warning \"-32\"]
module type Stack_renamed =
sig
type t[@@deriving rename]
include sig [@@@ocaml.warning \"-32\"] type t_renamed end[@@ocaml.doc
\"@inline\"]
[@@merlin.hide ]
include sig [@@@ocaml.warning \"-32\"] type t_renamed end[@@ocaml.doc
\"@inline\"]
[@@merlin.hide ]
type stack
val empty : stack
val is_empty : stack -> bool
val push : t -> stack -> stack
val pop : stack -> stack
val peek : stack -> t
end
end[@@ocaml.doc \"@inline\"][@@merlin.hide ]
]",
"notifications": []
}

on type stack
$ $MERLIN single expand-node -position 3:10 -filename ./apc.mli < ./apc.mli
{
"class": "return",
"value": "No PPX deriver/extension node found on this position",
"notifications": []
}

on attribute name deriving of module Stack
$ $MERLIN single expand-node -position 9:8 -filename ./apc.mli < ./apc.mli
{
"class": "return",
"value": "[ module type Stack =
sig
type t
type t[@@deriving rename]
include sig [@@@ocaml.warning \"-32\"] type t_renamed end[@@ocaml.doc
\"@inline\"]
[@@merlin.hide ]
type stack
val empty : stack
val is_empty : stack -> bool
Expand All @@ -420,7 +482,13 @@ Module type declaration in signature
[@@@ocaml.warning \"-32\"]
module type Stack_renamed =
sig
type t
type t[@@deriving rename]
include sig [@@@ocaml.warning \"-32\"] type t_renamed end[@@ocaml.doc
\"@inline\"]
[@@merlin.hide ]
include sig [@@@ocaml.warning \"-32\"] type t_renamed end[@@ocaml.doc
\"@inline\"]
[@@merlin.hide ]
type stack
val empty : stack
val is_empty : stack -> bool
Expand Down

0 comments on commit 0942b58

Please sign in to comment.