Skip to content

Commit

Permalink
Add more bunch of test and remove old FIXME
Browse files Browse the repository at this point in the history
  • Loading branch information
xvw committed Apr 10, 2024
1 parent 615014e commit 86e76b3
Showing 1 changed file with 78 additions and 3 deletions.
81 changes: 78 additions & 3 deletions tests/test-dirs/destruct/destruct-fun.t
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ Test case-analysis on a function parameter:
> let f x (bb : bool) y = something
> EOF

FIXME UPGRADE 5.2: this was working before the upgrade
$ $MERLIN single case-analysis -start 1:10 -end 1:11 \
> -filename fun.ml <fun.ml | \
> sed -e 's/, /,/g' | sed -e 's/ *| */|/g' | tr -d '\n' | jq '.'
Expand Down Expand Up @@ -55,7 +54,6 @@ FIXME UPGRADE 5.2: this was working before the upgrade
> let f x ((false as bb) : bool) y = something
> EOF

FIXME UPGRADE 5.2: this was not working before the upgrade
$ $MERLIN single case-analysis -start 1:11 -end 1:15 \
> -filename fun.ml <fun.ml | \
> sed -e 's/, /,/g' | sed -e 's/ *| */|/g' | tr -d '\n' | jq '.'
Expand All @@ -81,7 +79,6 @@ FIXME UPGRADE 5.2: this was not working before the upgrade
> let f x (_ as bb : bool) y = something
> EOF

FIXME UPGRADE 5.2: this was working before the upgrade
$ $MERLIN single case-analysis -start 1:10 -end 1:10 \
> -filename fun.ml <fun.ml | \
> sed -e 's/, /,/g' | sed -e 's/ *| */|/g' | tr -d '\n' | jq '.'
Expand Down Expand Up @@ -154,3 +151,81 @@ FIXME UPGRADE 5.2: this was working before the upgrade
],
"notifications": []
}

$ cat >fun.ml <<EOF
> type t = Foo of int option * string
> let f a (b: t) c = something
> EOF

$ $MERLIN single case-analysis -start 2:10 -end 2:10 \
> -filename fun.ml <fun.ml | \
> sed -e 's/, /,/g' | sed -e 's/ *| */|/g' | tr '\n' ' ' | jq '.'
{
"class": "return",
"value": [
{
"start": {
"line": 2,
"col": 9
},
"end": {
"line": 2,
"col": 10
}
},
"Foo (_,_)"
],
"notifications": []
}

$ cat >fun.ml <<EOF
> type t = Foo of { foo: int; bar: string }
> let f a (b: t) c = something
> EOF

$ $MERLIN single case-analysis -start 2:10 -end 2:10 \
> -filename fun.ml <fun.ml | \
> sed -e 's/, /,/g' | sed -e 's/ *| */|/g' | tr '\n' ' ' | jq '.'
{
"class": "return",
"value": [
{
"start": {
"line": 2,
"col": 9
},
"end": {
"line": 2,
"col": 10
}
},
"Foo _"
],
"notifications": []
}

$ cat >fun.ml <<EOF
> type _ t = Foo : int t | Bar : float t
> let f a (b: int t) c = something
> EOF

$ $MERLIN single case-analysis -start 2:10 -end 2:10 \
> -filename fun.ml <fun.ml | \
> sed -e 's/, /,/g' | sed -e 's/ *| */|/g' | tr -d '\n' | jq '.'
{
"class": "return",
"value": [
{
"start": {
"line": 2,
"col": 9
},
"end": {
"line": 2,
"col": 10
}
},
"Foo"
],
"notifications": []
}

0 comments on commit 86e76b3

Please sign in to comment.