Skip to content

Commit

Permalink
fix: re-enable failing tests + fix location tests (#850)
Browse files Browse the repository at this point in the history
* fix: re-enable failing tests + fix location tests

* update flakes

* fix tests
  • Loading branch information
anmonteiro authored Aug 11, 2024
1 parent ae18db0 commit 1b97ad5
Show file tree
Hide file tree
Showing 8 changed files with 200 additions and 241 deletions.
6 changes: 3 additions & 3 deletions dune-project
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@
(reason-react-ppx
(= :version))
(reason
(>= 3.10.0))
(>= 3.12.0))
(ocaml-lsp-server :with-dev-setup)
(opam-check-npm-deps
(and
Expand All @@ -57,9 +57,9 @@
(depends
ocaml
(reason
(>= 3.10.0))
(>= 3.12.0))
(ppxlib
(>= 0.28.0))
(>= 0.33.0))
(merlin :with-test)
(ocamlformat
(and
Expand Down
14 changes: 7 additions & 7 deletions flake.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 0 additions & 5 deletions ppx/test/dune
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,3 @@
%{bin:jq}
%{bin:ocamlmerlin}
ppx.sh))

(cram
(applies_to simple uppercase)
;; Disabled until https://github.com/reasonml/reason/issues/2737 is fixed
(enabled_if false))
188 changes: 184 additions & 4 deletions ppx/test/hover.t
Original file line number Diff line number Diff line change
Expand Up @@ -42,16 +42,100 @@ Let's test hovering over parts of the component
"type": "string -> React.element",
"tail": "no"
},
{
"start": {
"line": 3,
"col": 17
},
"end": {
"line": 3,
"col": 33
},
"type": "React.element",
"tail": "no"
},
{
"start": {
"line": 2,
"col": 2
},
"end": {
"line": 4,
"col": 15
},
"type": "React.element array",
"tail": "no"
},
{
"start": {
"line": 2,
"col": 2
},
"end": {
"line": 4,
"col": 15
},
"type": "React.element",
"tail": "no"
},
{
"start": {
"line": 2,
"col": 2
},
"end": {
"line": 4,
"col": 15
},
"type": "React.element option",
"tail": "no"
},
{
"start": {
"line": 2,
"col": 2
},
"end": {
"line": 4,
"col": 15
},
"type": "ReactDOM.domProps",
"tail": "no"
},
{
"start": {
"line": 2,
"col": 2
},
"end": {
"line": 4,
"col": 15
},
"type": "React.element",
"tail": "no"
},
{
"start": {
"line": 1,
"col": 0
"col": 32
},
"end": {
"line": 4,
"col": 15
},
"type": "< bar : int; foo : string > Js.t -> React.element",
"type": "bar:int -> React.element",
"tail": "no"
},
{
"start": {
"line": 1,
"col": 27
},
"end": {
"line": 4,
"col": 15
},
"type": "foo:string -> bar:int -> React.element",
"tail": "no"
}
]
Expand All @@ -61,16 +145,112 @@ The `foo` variable inside the component body
$ ocamlmerlin single type-enclosing -position 3:31 -verbosity 0 \
> -filename component.ml < component.ml | jq '.value'
[
{
"start": {
"line": 3,
"col": 30
},
"end": {
"line": 3,
"col": 33
},
"type": "string",
"tail": "no"
},
{
"start": {
"line": 3,
"col": 17
},
"end": {
"line": 3,
"col": 33
},
"type": "React.element",
"tail": "no"
},
{
"start": {
"line": 2,
"col": 2
},
"end": {
"line": 4,
"col": 15
},
"type": "React.element array",
"tail": "no"
},
{
"start": {
"line": 2,
"col": 2
},
"end": {
"line": 4,
"col": 15
},
"type": "React.element",
"tail": "no"
},
{
"start": {
"line": 2,
"col": 2
},
"end": {
"line": 4,
"col": 15
},
"type": "React.element option",
"tail": "no"
},
{
"start": {
"line": 2,
"col": 2
},
"end": {
"line": 4,
"col": 15
},
"type": "ReactDOM.domProps",
"tail": "no"
},
{
"start": {
"line": 2,
"col": 2
},
"end": {
"line": 4,
"col": 15
},
"type": "React.element",
"tail": "no"
},
{
"start": {
"line": 1,
"col": 32
},
"end": {
"line": 4,
"col": 15
},
"type": "bar:int -> React.element",
"tail": "no"
},
{
"start": {
"line": 1,
"col": 0
"col": 27
},
"end": {
"line": 4,
"col": 15
},
"type": "< bar : int; foo : string > Js.t -> React.element",
"type": "foo:string -> bar:int -> React.element",
"tail": "no"
}
]
6 changes: 3 additions & 3 deletions ppx/test/location.t/run.t
Original file line number Diff line number Diff line change
Expand Up @@ -2177,9 +2177,9 @@
((pos_fname output.ml) (pos_lnum 3) (pos_bol 151)
(pos_cnum 179)))
(loc_end
((pos_fname output.ml) (pos_lnum 3) (pos_bol 151)
(pos_cnum 181)))
(loc_ghost false)))
((pos_fname output.ml) (pos_lnum 7) (pos_bol 359)
(pos_cnum 371)))
(loc_ghost true)))
(pexp_loc_stack ()) (pexp_attributes ()))))
(pexp_loc
((loc_start
Expand Down
Loading

0 comments on commit 1b97ad5

Please sign in to comment.