Skip to content

Commit 1b97ad5

Browse files
authored
fix: re-enable failing tests + fix location tests (#850)
* fix: re-enable failing tests + fix location tests * update flakes * fix tests
1 parent ae18db0 commit 1b97ad5

File tree

8 files changed

+200
-241
lines changed

8 files changed

+200
-241
lines changed

dune-project

+3-3
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@
3939
(reason-react-ppx
4040
(= :version))
4141
(reason
42-
(>= 3.10.0))
42+
(>= 3.12.0))
4343
(ocaml-lsp-server :with-dev-setup)
4444
(opam-check-npm-deps
4545
(and
@@ -57,9 +57,9 @@
5757
(depends
5858
ocaml
5959
(reason
60-
(>= 3.10.0))
60+
(>= 3.12.0))
6161
(ppxlib
62-
(>= 0.28.0))
62+
(>= 0.33.0))
6363
(merlin :with-test)
6464
(ocamlformat
6565
(and

flake.lock

+7-7
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

ppx/test/dune

-5
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,3 @@
88
%{bin:jq}
99
%{bin:ocamlmerlin}
1010
ppx.sh))
11-
12-
(cram
13-
(applies_to simple uppercase)
14-
;; Disabled until https://github.com/reasonml/reason/issues/2737 is fixed
15-
(enabled_if false))

ppx/test/hover.t

+184-4
Original file line numberDiff line numberDiff line change
@@ -42,16 +42,100 @@ Let's test hovering over parts of the component
4242
"type": "string -> React.element",
4343
"tail": "no"
4444
},
45+
{
46+
"start": {
47+
"line": 3,
48+
"col": 17
49+
},
50+
"end": {
51+
"line": 3,
52+
"col": 33
53+
},
54+
"type": "React.element",
55+
"tail": "no"
56+
},
57+
{
58+
"start": {
59+
"line": 2,
60+
"col": 2
61+
},
62+
"end": {
63+
"line": 4,
64+
"col": 15
65+
},
66+
"type": "React.element array",
67+
"tail": "no"
68+
},
69+
{
70+
"start": {
71+
"line": 2,
72+
"col": 2
73+
},
74+
"end": {
75+
"line": 4,
76+
"col": 15
77+
},
78+
"type": "React.element",
79+
"tail": "no"
80+
},
81+
{
82+
"start": {
83+
"line": 2,
84+
"col": 2
85+
},
86+
"end": {
87+
"line": 4,
88+
"col": 15
89+
},
90+
"type": "React.element option",
91+
"tail": "no"
92+
},
93+
{
94+
"start": {
95+
"line": 2,
96+
"col": 2
97+
},
98+
"end": {
99+
"line": 4,
100+
"col": 15
101+
},
102+
"type": "ReactDOM.domProps",
103+
"tail": "no"
104+
},
105+
{
106+
"start": {
107+
"line": 2,
108+
"col": 2
109+
},
110+
"end": {
111+
"line": 4,
112+
"col": 15
113+
},
114+
"type": "React.element",
115+
"tail": "no"
116+
},
45117
{
46118
"start": {
47119
"line": 1,
48-
"col": 0
120+
"col": 32
49121
},
50122
"end": {
51123
"line": 4,
52124
"col": 15
53125
},
54-
"type": "< bar : int; foo : string > Js.t -> React.element",
126+
"type": "bar:int -> React.element",
127+
"tail": "no"
128+
},
129+
{
130+
"start": {
131+
"line": 1,
132+
"col": 27
133+
},
134+
"end": {
135+
"line": 4,
136+
"col": 15
137+
},
138+
"type": "foo:string -> bar:int -> React.element",
55139
"tail": "no"
56140
}
57141
]
@@ -61,16 +145,112 @@ The `foo` variable inside the component body
61145
$ ocamlmerlin single type-enclosing -position 3:31 -verbosity 0 \
62146
> -filename component.ml < component.ml | jq '.value'
63147
[
148+
{
149+
"start": {
150+
"line": 3,
151+
"col": 30
152+
},
153+
"end": {
154+
"line": 3,
155+
"col": 33
156+
},
157+
"type": "string",
158+
"tail": "no"
159+
},
160+
{
161+
"start": {
162+
"line": 3,
163+
"col": 17
164+
},
165+
"end": {
166+
"line": 3,
167+
"col": 33
168+
},
169+
"type": "React.element",
170+
"tail": "no"
171+
},
172+
{
173+
"start": {
174+
"line": 2,
175+
"col": 2
176+
},
177+
"end": {
178+
"line": 4,
179+
"col": 15
180+
},
181+
"type": "React.element array",
182+
"tail": "no"
183+
},
184+
{
185+
"start": {
186+
"line": 2,
187+
"col": 2
188+
},
189+
"end": {
190+
"line": 4,
191+
"col": 15
192+
},
193+
"type": "React.element",
194+
"tail": "no"
195+
},
196+
{
197+
"start": {
198+
"line": 2,
199+
"col": 2
200+
},
201+
"end": {
202+
"line": 4,
203+
"col": 15
204+
},
205+
"type": "React.element option",
206+
"tail": "no"
207+
},
208+
{
209+
"start": {
210+
"line": 2,
211+
"col": 2
212+
},
213+
"end": {
214+
"line": 4,
215+
"col": 15
216+
},
217+
"type": "ReactDOM.domProps",
218+
"tail": "no"
219+
},
220+
{
221+
"start": {
222+
"line": 2,
223+
"col": 2
224+
},
225+
"end": {
226+
"line": 4,
227+
"col": 15
228+
},
229+
"type": "React.element",
230+
"tail": "no"
231+
},
232+
{
233+
"start": {
234+
"line": 1,
235+
"col": 32
236+
},
237+
"end": {
238+
"line": 4,
239+
"col": 15
240+
},
241+
"type": "bar:int -> React.element",
242+
"tail": "no"
243+
},
64244
{
65245
"start": {
66246
"line": 1,
67-
"col": 0
247+
"col": 27
68248
},
69249
"end": {
70250
"line": 4,
71251
"col": 15
72252
},
73-
"type": "< bar : int; foo : string > Js.t -> React.element",
253+
"type": "foo:string -> bar:int -> React.element",
74254
"tail": "no"
75255
}
76256
]

ppx/test/location.t/run.t

+3-3
Original file line numberDiff line numberDiff line change
@@ -2177,9 +2177,9 @@
21772177
((pos_fname output.ml) (pos_lnum 3) (pos_bol 151)
21782178
(pos_cnum 179)))
21792179
(loc_end
2180-
((pos_fname output.ml) (pos_lnum 3) (pos_bol 151)
2181-
(pos_cnum 181)))
2182-
(loc_ghost false)))
2180+
((pos_fname output.ml) (pos_lnum 7) (pos_bol 359)
2181+
(pos_cnum 371)))
2182+
(loc_ghost true)))
21832183
(pexp_loc_stack ()) (pexp_attributes ()))))
21842184
(pexp_loc
21852185
((loc_start

0 commit comments

Comments
 (0)