Skip to content

Commit a0704f8

Browse files
committed
Adapt analysis tests.
1 parent 490e6fb commit a0704f8

File tree

25 files changed

+389
-830
lines changed

25 files changed

+389
-830
lines changed

tests/analysis_tests/tests-generic-jsx-transform/src/expected/GenericJsxCompletion.res.txt

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@ posCursor:[0:8] posNoWhite:[0:6] Found expr:[0:4->0:7]
33
JSX <div:[0:4->0:7] > _children:None
44
Completable: Cjsx([div], "", [])
55
Package opens Pervasives.JsxModules.place holder
6-
Resolved opens 1 Pervasives
76
Path GenericJsx.Elements.props
87
[{
98
"label": "testing",
@@ -30,7 +29,6 @@ posCursor:[3:17] posNoWhite:[3:16] Found expr:[3:4->3:18]
3029
JSX <div:[3:4->3:7] testing[3:8->3:15]=...[3:16->3:18]> _children:None
3130
Completable: Cexpression CJsxPropValue [div] testing->recordBody
3231
Package opens Pervasives.JsxModules.place holder
33-
Resolved opens 1 Pervasives
3432
ContextPath CJsxPropValue [div] testing
3533
Path GenericJsx.Elements.props
3634
[{
@@ -59,7 +57,6 @@ posCursor:[14:21] posNoWhite:[14:20] Found expr:[14:7->22:10]
5957
posCursor:[14:21] posNoWhite:[14:20] Found expr:[14:7->14:21]
6058
Completable: Cpath Value[someString]->st <<jsx>>
6159
Package opens Pervasives.JsxModules.place holder
62-
Resolved opens 1 Pervasives
6360
ContextPath Value[someString]->st <<jsx>>
6461
ContextPath Value[someString]
6562
Path someString
@@ -108,7 +105,7 @@ posCursor:[20:24] posNoWhite:[20:23] Found expr:[20:10->20:24]
108105
Completable: Cpath Value[someString]->st <<jsx>>
109106
Raw opens: 1 GenericJsx.place holder
110107
Package opens Pervasives.JsxModules.place holder
111-
Resolved opens 2 Pervasives GenericJsx
108+
Resolved opens 1 GenericJsx
112109
ContextPath Value[someString]->st <<jsx>>
113110
ContextPath Value[someString]
114111
Path someString

tests/analysis_tests/tests-incremental-typechecking/src/expected/ConstructorCompletion__Json.res.txt

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,14 +5,13 @@ Json
55
Array:[0:8->0:21] [0:21->0:23]
66
Completable: Cexpression CTypeAtPos()->variantPayload::Array($0)
77
Package opens Pervasives.JsxModules.place holder
8-
Resolved opens 1 Pervasives
98
ContextPath CTypeAtPos()
109
[{
1110
"label": "[]",
1211
"kind": 12,
1312
"tags": [],
1413
"detail": "t",
15-
"documentation": {"kind": "markdown", "value": " The JSON data structure \n\n```rescript\n@unboxed\ntype t =\n | Boolean(bool)\n | @as(null) Null\n | String(string)\n | Number(float)\n | Object(Js.Dict.t<t>)\n | Array(array<t>)\n```"},
14+
"documentation": {"kind": "markdown", "value": " The JSON data structure \n\n```rescript\n@unboxed\ntype t =\n | Boolean(bool)\n | @as(null) Null\n | String(string)\n | Number(float)\n | Object(dict<t>)\n | Array(array<t>)\n```"},
1615
"sortText": "A",
1716
"insertText": "[$0]",
1817
"insertTextFormat": 2

tests/analysis_tests/tests-incremental-typechecking/src/expected/ConstructorCompletion__Own.res.txt

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@ Pexp_construct WithVariant
44
One:[4:8->4:23] [4:23->4:25]
55
Completable: Cexpression CTypeAtPos()->variantPayload::One($0)
66
Package opens Pervasives.JsxModules.place holder
7-
Resolved opens 1 Pervasives
87
ContextPath CTypeAtPos()
98
[{
109
"label": "{}",

tests/analysis_tests/tests-reanalyze/deadcode/expected/deadcode.txt

Lines changed: 259 additions & 386 deletions
Large diffs are not rendered by default.

tests/analysis_tests/tests-reanalyze/deadcode/expected/exception.txt

Lines changed: 35 additions & 67 deletions
Original file line numberDiff line numberDiff line change
@@ -17,111 +17,79 @@
1717
callsRaiseWithAnnotationAndIsAnnotated might raise Not_found (Exn.res:22:45) and is annotated with redundant @raises(A)
1818

1919
Exception Analysis
20-
Exn.res:24:5
21-
z might raise Failure (Exn.res:24:8) and is not annotated with @raises(Failure)
20+
Exn.res:24:5-19
21+
incompleteMatch might raise Match_failure (Exn.res:25:2) and is not annotated with @raises(Match_failure)
2222

2323
Exception Analysis
24-
Exn.res:26:5-19
25-
incompleteMatch might raise Match_failure (Exn.res:27:2) and is not annotated with @raises(Match_failure)
24+
Exn.res:32:5-13
25+
twoRaises might raise [A (Exn.res:34:4), B (Exn.res:37:4)] and is not annotated with @raises([A, B])
2626

2727
Exception Analysis
28-
Exn.res:34:5-13
29-
twoRaises might raise [A (Exn.res:36:4), B (Exn.res:39:4)] and is not annotated with @raises([A, B])
28+
Exn.res:41:5-14
29+
sequencing might raise A (Exn.res:42:2) and is not annotated with @raises(A)
3030

3131
Exception Analysis
32-
Exn.res:43:5-14
33-
sequencing might raise A (Exn.res:44:2) and is not annotated with @raises(A)
32+
Exn.res:48:5-14
33+
wrongCatch might raise B (Exn.res:49:6) and is not annotated with @raises(B)
3434

3535
Exception Analysis
36-
Exn.res:50:5-14
37-
wrongCatch might raise B (Exn.res:51:6) and is not annotated with @raises(B)
36+
Exn.res:54:5-15
37+
wrongCatch2 might raise [C (Exn.res:55:24), Match_failure (Exn.res:55:2)] and is not annotated with @raises([C, Match_failure])
3838

3939
Exception Analysis
40-
Exn.res:56:5-15
41-
wrongCatch2 might raise [C (Exn.res:57:24), Match_failure (Exn.res:57:2)] and is not annotated with @raises([C, Match_failure])
40+
Exn.res:62:5-19
41+
raise2Annotate3 might raise [A (Exn.res:64:4), B (Exn.res:67:4)] and is annotated with redundant @raises(C)
4242

4343
Exception Analysis
44-
Exn.res:64:5-19
45-
raise2Annotate3 might raise [A (Exn.res:66:4), B (Exn.res:69:4)] and is annotated with redundant @raises(C)
44+
Exn.res:73:5-24
45+
parse_json_from_file might raise Error (Exn.res:76:4) and is not annotated with @raises(Error)
4646

4747
Exception Analysis
48-
Exn.res:75:5-24
49-
parse_json_from_file might raise Error (Exn.res:78:4) and is not annotated with @raises(Error)
48+
Exn.res:82:5-11
49+
reRaise might raise B (Exn.res:84:19) and is not annotated with @raises(B)
5050

5151
Exception Analysis
52-
Exn.res:84:5-11
53-
reRaise might raise B (Exn.res:86:19) and is not annotated with @raises(B)
52+
Exn.res:93:5-22
53+
raiseInInternalLet might raise A (Exn.res:94:14) and is not annotated with @raises(A)
5454

5555
Exception Analysis
56-
Exn.res:95:5-22
57-
raiseInInternalLet might raise A (Exn.res:96:14) and is not annotated with @raises(A)
56+
Exn.res:98:5-16
57+
indirectCall might raise Not_found (Exn.res:98:31) and is not annotated with @raises(Not_found)
5858

5959
Exception Analysis
60-
Exn.res:100:5-16
61-
indirectCall might raise Not_found (Exn.res:100:31) and is not annotated with @raises(Not_found)
60+
Exn.res:124:5-16
61+
severalCases might raise Failure (Exn.res:126:13 Exn.res:127:13 Exn.res:128:15) and is not annotated with @raises(Failure)
6262

6363
Exception Analysis
64-
Exn.res:148:5-16
65-
severalCases might raise Failure (Exn.res:150:13 Exn.res:151:13 Exn.res:152:15) and is not annotated with @raises(Failure)
66-
67-
Exception Analysis
68-
Exn.res:159:32-56
69-
String.uncapitalize_ascii does not raise and is annotated with redundant @doesNotRaise
70-
71-
Exception Analysis
72-
Exn.res:161:32-63
73-
String.uncapitalize_ascii does not raise and is annotated with redundant @doesNotRaise
74-
75-
Exception Analysis
76-
Exn.res:163:47-71
77-
String.uncapitalize_ascii does not raise and is annotated with redundant @doesNotRaise
78-
79-
Exception Analysis
80-
Exn.res:163:47-79
81-
expression does not raise and is annotated with redundant @doesNotRaise
82-
83-
Exception Analysis
84-
Exn.res:169:51-55
85-
expression does not raise and is annotated with redundant @doesNotRaise
86-
87-
Exception Analysis
88-
Exn.res:167:25-56
89-
String.uncapitalize_ascii does not raise and is annotated with redundant @doesNotRaise
90-
91-
Exception Analysis
92-
Exn.res:176:5-23
64+
Exn.res:136:5-23
9365
redundantAnnotation raises nothing and is annotated with redundant @raises(Invalid_argument)
9466

9567
Exception Analysis
96-
Exn.res:178:5-6
97-
_x might raise A (Exn.res:178:9) and is not annotated with @raises(A)
98-
99-
Exception Analysis
100-
Exn.res:180:5
101-
_ might raise A (Exn.res:180:8) and is not annotated with @raises(A)
68+
Exn.res:138:5-6
69+
_x might raise A (Exn.res:138:9) and is not annotated with @raises(A)
10270

10371
Exception Analysis
104-
Exn.res:182:5-6
105-
() might raise A (Exn.res:182:9) and is not annotated with @raises(A)
72+
Exn.res:140:5
73+
_ might raise A (Exn.res:140:8) and is not annotated with @raises(A)
10674

10775
Exception Analysis
108-
Exn.res:184:1-16
109-
Toplevel expression might raise Not_found (Exn.res:184:0) and is not annotated with @raises(Not_found)
76+
Exn.res:142:5-6
77+
() might raise A (Exn.res:142:9) and is not annotated with @raises(A)
11078

11179
Exception Analysis
112-
Exn.res:186:1-19
113-
Toplevel expression might raise exit (Exn.res:186:7) and is not annotated with @raises(exit)
80+
Exn.res:144:1-16
81+
Toplevel expression might raise Not_found (Exn.res:144:0) and is not annotated with @raises(Not_found)
11482

11583
Exception Analysis
116-
Exn.res:196:45-46
84+
Exn.res:154:45-46
11785
expression does not raise and is annotated with redundant @doesNotRaise
11886

11987
Exception Analysis
120-
Exn.res:196:5-21
121-
onResultPipeWrong might raise Assert_failure (Exn.res:196:48) and is not annotated with @raises(Assert_failure)
88+
Exn.res:154:5-21
89+
onResultPipeWrong might raise Assert_failure (Exn.res:154:48) and is not annotated with @raises(Assert_failure)
12290

12391
Exception Analysis
12492
ExnA.res:1:5-7
12593
bar might raise Not_found (ExnA.res:1:16) and is not annotated with @raises(Not_found)
12694

127-
Analysis reported 31 issues (Exception Analysis:31)
95+
Analysis reported 23 issues (Exception Analysis:23)

0 commit comments

Comments
 (0)