Skip to content

Commit

Permalink
Add test demonstrating issue
Browse files Browse the repository at this point in the history
  • Loading branch information
liam923 committed Sep 25, 2024
1 parent 04b59dc commit 5fb1560
Showing 1 changed file with 68 additions and 0 deletions.
68 changes: 68 additions & 0 deletions tests/test-dirs/occurrences/project-wide/pwo-canonicalize.t
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
$ cat > lib.ml << EOF
> let foo = "bar"
> let () = print_string foo
> EOF

$ cat > main.ml << EOF
> let () = print_string Lib.foo
> EOF

$ cat > .merlin << EOF
> INDEX project.ocaml-index
> SOURCE_ROOT .
> EOF

$ ocamlc -bin-annot -bin-annot-occurrences -c lib.ml main.ml
$ ocaml-index aggregate main.cmt lib.cmt --root . --rewrite-root

TODO: definition is duplicated
TODO: result paths have a . in them

$ ocamlmerlin single occurrences -scope project -identifier-at 1:4 \
> -filename lib.ml < lib.ml | jq .value
[
{
"file": "$TESTCASE_ROOT/lib.ml",
"start": {
"line": 1,
"col": 4
},
"end": {
"line": 1,
"col": 7
}
},
{
"file": "$TESTCASE_ROOT/./lib.ml",
"start": {
"line": 1,
"col": 4
},
"end": {
"line": 1,
"col": 7
}
},
{
"file": "$TESTCASE_ROOT/./lib.ml",
"start": {
"line": 2,
"col": 22
},
"end": {
"line": 2,
"col": 25
}
},
{
"file": "$TESTCASE_ROOT/./main.ml",
"start": {
"line": 1,
"col": 26
},
"end": {
"line": 1,
"col": 29
}
}
]

0 comments on commit 5fb1560

Please sign in to comment.