-
Notifications
You must be signed in to change notification settings - Fork 234
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
test: renaming a functor value included from its parameter
- Loading branch information
Showing
6 changed files
with
51 additions
and
0 deletions.
There are no files selected for viewing
2 changes: 2 additions & 0 deletions
2
tests/test-dirs/occurrences/project-wide/for-renaming/r-with-functors.t/dune
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,2 @@ | ||
(executable | ||
(name main)) |
1 change: 1 addition & 0 deletions
1
tests/test-dirs/occurrences/project-wide/for-renaming/r-with-functors.t/dune-project
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 @@ | ||
(lang dune 3.17) |
5 changes: 5 additions & 0 deletions
5
tests/test-dirs/occurrences/project-wide/for-renaming/r-with-functors.t/func.ml
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,5 @@ | ||
module type P = sig val txt : string end | ||
|
||
module Make (Params : sig val txt : string end) = struct | ||
include Params | ||
end |
5 changes: 5 additions & 0 deletions
5
tests/test-dirs/occurrences/project-wide/for-renaming/r-with-functors.t/func.mli
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,5 @@ | ||
module type P = sig val txt : string end | ||
|
||
module Make (_ : P) : sig | ||
include P | ||
end |
4 changes: 4 additions & 0 deletions
4
tests/test-dirs/occurrences/project-wide/for-renaming/r-with-functors.t/main.ml
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,4 @@ | ||
module P = struct let txt = "Hello world!" end;; | ||
module M = Func.Make(P);; | ||
|
||
print_endline M.txt |
34 changes: 34 additions & 0 deletions
34
tests/test-dirs/occurrences/project-wide/for-renaming/r-with-functors.t/run.t
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,34 @@ | ||
|
||
$ $DUNE build @ocaml-index | ||
|
||
$ $DUNE exec ./main.exe | ||
Hello world! | ||
|
||
We expect 2 occurrences in func.ml, 1 in func.mli and 2 in main.ml | ||
$ $MERLIN single occurrences -scope renaming -identifier-at 4:18 \ | ||
> -filename main.ml <main.ml | jq '.value[] | .file,.start' | ||
"$TESTCASE_ROOT/main.ml" | ||
{ | ||
"line": 1, | ||
"col": 22 | ||
} | ||
"$TESTCASE_ROOT/func.ml" | ||
{ | ||
"line": 1, | ||
"col": 24 | ||
} | ||
"$TESTCASE_ROOT/func.ml" | ||
{ | ||
"line": 3, | ||
"col": 30 | ||
} | ||
"$TESTCASE_ROOT/func.mli" | ||
{ | ||
"line": 1, | ||
"col": 24 | ||
} | ||
"$TESTCASE_ROOT/main.ml" | ||
{ | ||
"line": 4, | ||
"col": 16 | ||
} |