Skip to content

Commit

Permalink
test: promote improvements in testsuite
Browse files Browse the repository at this point in the history
  • Loading branch information
voodoos committed Feb 19, 2024
1 parent bfe31e5 commit 13d7c14
Show file tree
Hide file tree
Showing 2 changed files with 59 additions and 76 deletions.
32 changes: 0 additions & 32 deletions tests/test-dirs/config/flags/unsafe.t
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,6 @@ Testing array desugaring
"notifications": []
}

FIXME UPGRADE 5.2: this test show additionnal warnings after the 5.2 upgrade; probably a
type that should be marked as incorrect is not anymore.
$ $MERLIN single errors -filename array_bad.ml <<EOF
> module Array = struct end
> let x = [|0|].(0)
Expand All @@ -31,20 +29,6 @@ type that should be marked as incorrect is not anymore.
"sub": [],
"valid": true,
"message": "Unbound value Array.get"
},
{
"start": {
"line": 2,
"col": 15
},
"end": {
"line": 2,
"col": 16
},
"type": "warning",
"sub": [],
"valid": true,
"message": "Warning 20: this argument will not be used by the function."
}
],
"notifications": []
Expand All @@ -69,8 +53,6 @@ type that should be marked as incorrect is not anymore.
"notifications": []
}

FIXME UPGRADE 5.2: this test show additionnal warnings after the 5.2 upgrade; probably a
type that should be marked as incorrect is not anymore.
$ $MERLIN single errors -filename unsafe_array_bad.ml -unsafe <<EOF
> module Array = struct end
> let x = [|0|].(0)
Expand All @@ -91,20 +73,6 @@ type that should be marked as incorrect is not anymore.
"sub": [],
"valid": true,
"message": "Unbound value Array.unsafe_get"
},
{
"start": {
"line": 2,
"col": 15
},
"end": {
"line": 2,
"col": 16
},
"type": "warning",
"sub": [],
"valid": true,
"message": "Warning 20: this argument will not be used by the function."
}
],
"notifications": []
Expand Down
103 changes: 59 additions & 44 deletions tests/test-dirs/function-recovery.t
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
"value": "[
structure_item (test.ml[1,0+0]..test.ml[3,104+28])
Tstr_module
ERROR_locate_from_inside_function_literal_used_as_non_function/278
ERROR_locate_from_inside_function_literal_used_as_non_function/279
module_expr (test.ml[1,0+72]..test.ml[3,104+28])
Tmod_structure
[
Expand Down Expand Up @@ -44,7 +44,16 @@
]
Tfunction_body
expression (test.ml[3,104+21]..test.ml[3,104+28])
Texp_ident \"problem/276\"
attribute \"merlin.incorrect\"
[]
attribute \"merlin.saved-parts\"
[
structure_item (_none_[0,0+-1]..[0,0+-1]) ghost
Pstr_eval
expression (_none_[0,0+-1]..[0,0+-1]) ghost
Pexp_constant PConst_int (1,None)
]
Texp_ident \"*type-error*/277\"
]
]
]
Expand Down Expand Up @@ -250,23 +259,11 @@
"col": 8
},
"ghost": false,
"attrs": [
{
"start": {
"line": 0,
"col": -1
},
"end": {
"line": 0,
"col": -1
},
"name": "merlin.incorrect"
}
],
"attrs": [],
"kind": "pattern (test.ml[2,27+4]..test.ml[2,27+8])
attribute \"merlin.incorrect\"
[]
Tpat_any
Tpat_construct \"None\"
[]
None
",
"children": []
},
Expand Down Expand Up @@ -324,25 +321,34 @@
"col": 10
},
"ghost": false,
"attrs": [
"attrs": [],
"kind": "pattern (test.ml[3,41+4]..test.ml[3,41+10])
Tpat_construct \"Some\"
[
pattern (test.ml[3,41+9]..test.ml[3,41+10])
Tpat_constant Const_int 5
]
None
",
"children": [
{
"filename": "test.ml",
"start": {
"line": 0,
"col": -1
"line": 3,
"col": 9
},
"end": {
"line": 0,
"col": -1
"line": 3,
"col": 10
},
"name": "merlin.incorrect"
}
],
"kind": "pattern (test.ml[3,41+4]..test.ml[3,41+10])
attribute \"merlin.incorrect\"
[]
Tpat_any
"ghost": false,
"attrs": [],
"kind": "pattern (test.ml[3,41+9]..test.ml[3,41+10])
Tpat_constant Const_int 5
",
"children": []
"children": []
}
]
},
{
"filename": "test.ml",
Expand Down Expand Up @@ -398,25 +404,34 @@
"col": 12
},
"ghost": false,
"attrs": [
"attrs": [],
"kind": "pattern (test.ml[4,57+4]..test.ml[4,57+12])
Tpat_construct \"Some\"
[
pattern (test.ml[4,57+9]..test.ml[4,57+12])
Tpat_var \"_aa/279\"
]
None
",
"children": [
{
"filename": "test.ml",
"start": {
"line": 0,
"col": -1
"line": 4,
"col": 9
},
"end": {
"line": 0,
"col": -1
"line": 4,
"col": 12
},
"name": "merlin.incorrect"
}
],
"kind": "pattern (test.ml[4,57+4]..test.ml[4,57+12])
attribute \"merlin.incorrect\"
[]
Tpat_any
"ghost": false,
"attrs": [],
"kind": "pattern (test.ml[4,57+9]..test.ml[4,57+12])
Tpat_var \"_aa/279\"
",
"children": []
"children": []
}
]
},
{
"filename": "test.ml",
Expand Down

0 comments on commit 13d7c14

Please sign in to comment.