Skip to content

Commit

Permalink
chore: fix blackbox tests
Browse files Browse the repository at this point in the history
  • Loading branch information
anmonteiro committed Jan 9, 2024
1 parent 3f743e2 commit 5c87d53
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 17 deletions.
6 changes: 0 additions & 6 deletions test/blackbox-tests/legacy-ounit-cmd.t
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,6 @@ Skip over the temporary file name printed in the error trace
Alert unused: Unused attribute [@u]
This means such annotation is not annotated properly.
For example, some annotations are only meaningful in externals
// Generated by Melange
'use strict';
Expand All @@ -66,7 +65,6 @@ Skip over the temporary file name printed in the error trace
Alert unused: Unused attribute [@mel.string]
This means such annotation is not annotated properly.
For example, some annotations are only meaningful in externals
// Generated by Melange
/* This output is empty. Its source's type definitions, externals and/or unused code got optimized away. */
Expand Down Expand Up @@ -95,7 +93,6 @@ Skip over the temporary file name printed in the error trace
Alert unused: Unused attribute [@mel.uncurry]
This means such annotation is not annotated properly.
For example, some annotations are only meaningful in externals
// Generated by Melange
/* This output is empty. Its source's type definitions, externals and/or unused code got optimized away. */
Expand All @@ -120,7 +117,6 @@ Skip over the temporary file name printed in the error trace
Alert unused: Unused attribute [@mel.string]
This means such annotation is not annotated properly.
For example, some annotations are only meaningful in externals
// Generated by Melange
/* This output is empty. Its source's type definitions, externals and/or unused code got optimized away. */
Expand Down Expand Up @@ -237,7 +233,6 @@ Skip over the temporary file name printed in the error trace
Alert unused: Unused attribute [@u]
This means such annotation is not annotated properly.
For example, some annotations are only meaningful in externals
// Generated by Melange
'use strict';
Expand All @@ -264,7 +259,6 @@ Skip over the temporary file name printed in the error trace
Alert unused: Unused attribute [@mel.string]
This means such annotation is not annotated properly.
For example, some annotations are only meaningful in externals
// Generated by Melange
/* This output is empty. Its source's type definitions, externals and/or unused code got optimized away. */
Expand Down
2 changes: 1 addition & 1 deletion test/blackbox-tests/mel-as-string-warnings.t
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ This external triggers the `redundant` alert
File "x.ml", line 1, characters 16-24:
1 | external foo : ([ `foo ][@mel.string]) -> string = "foo"
^^^^^^^^
Alert redundant: [@mel.string] is redundant here, you can safely remove it
Alert redundant: `[@mel.string]' is redundant here, you can safely remove it
// Generated by Melange
'use strict';
Expand Down
10 changes: 5 additions & 5 deletions test/blackbox-tests/mel-uncurry-nesting.t
Original file line number Diff line number Diff line change
Expand Up @@ -38,21 +38,21 @@ Using `mel.uncurry` at 2nd level of callbacks raises some alerts
This means such annotation is not annotated properly.
For example, some annotations are only meaningful in externals


File "x.ml", line 2, characters 52-63:
2 | (((unit -> unit)[@mel.uncurry]) -> (unit -> unit[@mel.uncurry])) -> unit
^^^^^^^^^^^
Alert unused: Unused attribute [@mel.uncurry]
This means such annotation is not annotated properly.
For example, some annotations are only meaningful in externals



In the case of uncurry nesting, we have to resort to the `[@u]` attribute

In the case of uncurry nesting, we have to resort to the `[@u]` / `[@u0]`
attributes

$ cat > x.ml <<EOF
> external foo : (((unit -> unit)[@u]) -> unit) -> unit = "foo"
> let () = foo (fun f -> f () [@u])
> external foo : (((unit -> unit)[@u0]) -> unit) -> unit = "foo"
> let () = foo (fun f -> f () [@u0])
> EOF
$ dune build @melange

8 changes: 4 additions & 4 deletions test/blackbox-tests/melange-playground/ppx-alerts.t
Original file line number Diff line number Diff line change
Expand Up @@ -13,28 +13,28 @@
js_warning_error_msg: 'Line 1, 18:\n' +
' Alert: unused Unused attribute [@mel.uncurry]\n' +
'This means such annotation is not annotated properly.\n' +
'For example, some annotations are only meaningful in externals\n',
'For example, some annotations are only meaningful in externals',
row: 0,
column: 18,
endRow: 0,
endColumn: 29,
text: 'Unused attribute [@mel.uncurry]\n' +
'This means such annotation is not annotated properly.\n' +
'For example, some annotations are only meaningful in externals\n',
'For example, some annotations are only meaningful in externals',
type: 'alert'
},
{
js_warning_error_msg: 'Line 1, 52:\n' +
' Alert: unused Unused attribute [@mel.uncurry]\n' +
'This means such annotation is not annotated properly.\n' +
'For example, some annotations are only meaningful in externals\n',
'For example, some annotations are only meaningful in externals',
row: 0,
column: 52,
endRow: 0,
endColumn: 63,
text: 'Unused attribute [@mel.uncurry]\n' +
'This means such annotation is not annotated properly.\n' +
'For example, some annotations are only meaningful in externals\n',
'For example, some annotations are only meaningful in externals',
type: 'alert'
}
],
Expand Down
1 change: 0 additions & 1 deletion test/blackbox-tests/unused-attributes.t
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@
Alert unused: Unused attribute [@mel.string]
This means such annotation is not annotated properly.
For example, some annotations are only meaningful in externals

// Generated by Melange
/* This output is empty. Its source's type definitions, externals and/or unused code got optimized away. */

Expand Down

0 comments on commit 5c87d53

Please sign in to comment.