Skip to content

Commit

Permalink
test: update positively impacted cases
Browse files Browse the repository at this point in the history
  • Loading branch information
voodoos committed Dec 1, 2022
1 parent 7cccf28 commit 2dcfaa6
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 14 deletions.
2 changes: 1 addition & 1 deletion tests/test-dirs/document/issue1513.t
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ FIXME: We should not rely on "fallbacking". This requires a compiler change.
> -log-file - -log-section locate \
> -filename main.ml <main.ml 2>&1 |
> grep "Uid not found in the cmt table"
Uid not found in the cmt table. Fallbacking to the node's location: File "naux.ml", line 2, characters 2-5
Uid not found in the cmt table. Fallbacking to the node's location: File "naux.ml", line 2, characters 2-3

FIXME: expected "B Comment"
$ $MERLIN single document -position 2:13 \
Expand Down
4 changes: 2 additions & 2 deletions tests/test-dirs/locate/context-detection/cd-test.t/run.t
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ Trying them all:
"file": "$TESTCASE_ROOT/test.ml",
"pos": {
"line": 1,
"col": 0
"col": 9
}
},
"notifications": []
Expand Down Expand Up @@ -109,7 +109,7 @@ FIXME we failed to parse/reconstruct the ident, that's interesting
"file": "$TESTCASE_ROOT/test.ml",
"pos": {
"line": 1,
"col": 0
"col": 9
}
},
"notifications": []
Expand Down
2 changes: 1 addition & 1 deletion tests/test-dirs/locate/issue802.t/run.t
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ Test jumping from a normal constructor:
"file": "$TESTCASE_ROOT/error.ml",
"pos": {
"line": 1,
"col": 0
"col": 9
}
},
"notifications": []
Expand Down
21 changes: 11 additions & 10 deletions tests/test-dirs/locate/locate-constrs.t
Original file line number Diff line number Diff line change
Expand Up @@ -3,46 +3,47 @@
**/

$ cat >constr.ml <<EOF
> type t = A of int | B
> let foo : t = A 42
> module C = struct type t = A of int | B end
> let foo : C.t = C.A 42
> EOF

$ $MERLIN single locate -look-for mli -position 2:14 \
We expect 1:27
$ $MERLIN single locate -look-for mli -position 2:18 \
> -filename ./constr.ml < ./constr.ml | jq '.value'
{
"file": "$TESTCASE_ROOT/constr.ml",
"pos": {
"line": 1,
"col": 9
"col": 27
}
}

FIXME: this is not a very satisfying answer.
We could expect 1:9
$ $MERLIN single locate -look-for ml -position 2:14 \
We expect 1:18
$ $MERLIN single locate -look-for ml -position 2:12 \
> -filename ./constr.ml < ./constr.ml | jq '.value'
{
"file": "$TESTCASE_ROOT/constr.ml",
"pos": {
"line": 1,
"col": 0
"col": 18
}
}

With the declaration in another compilation unit:
$ cat >other_module.ml <<EOF
> let foo = Constr.B
> let foo = Constr.C.B
> EOF

$ $OCAMLC -c -bin-annot constr.ml

$ $MERLIN single locate -look-for mli -position 1:17 \
$ $MERLIN single locate -look-for mli -position 1:19 \
> -filename ./other_module.ml < ./other_module.ml | jq '.value'
{
"file": "$TESTCASE_ROOT/constr.ml",
"pos": {
"line": 1,
"col": 18
"col": 36
}
}

Expand Down

0 comments on commit 2dcfaa6

Please sign in to comment.