Skip to content

Commit 37aa34f

Browse files
committed
test: promote test failure
1 parent 935d356 commit 37aa34f

File tree

2 files changed

+59
-0
lines changed

2 files changed

+59
-0
lines changed

test/class_types_3_dot_8.t/input.re

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
/* Copyright (c) 2015-present, Facebook, Inc. All rights reserved. */
2+
3+
[@reason.version 3.8];
4+
5+
class type _module ('provider_impl) = {
6+
7+
};
8+
type t;
9+
class type bzz = {
10+
inherit _module(t)
11+
};
12+
13+
class type t = { as 'a;
14+
constraint 'a = #s
15+
};
16+
17+
/* https://github.com/facebook/reason/issues/2037 */
18+
class type xt = { as 'a };
19+
20+
class x = {
21+
as self
22+
};
23+
24+
class type classWithNoArgType {
25+
pub x : int;
26+
pub y : int
27+
};
28+
29+
class classWithNoArg {
30+
pub x = 0;
31+
pub y = 0
32+
};
33+
34+
class type t = {
35+
open M;
36+
as 'a;
37+
};
38+
39+
class type t = {
40+
open M;
41+
};

test/class_types_3_dot_8.t/run.t

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
2+
Format basic
3+
$ refmt --print re ./input.re > ./formatted.re
4+
5+
Type-check basics
6+
$ ocamlc -c -pp 'refmt --print binary' -intf-suffix .rei -impl formatted.re
7+
File "formatted.re", line 13, characters 19-20:
8+
13 | constraint 'a = #s;
9+
^
10+
Error: Unbound class type s
11+
[2]
12+
13+
Format the formatted file back
14+
$ refmt --print re ./formatted.re > ./formatted_back.re
15+
16+
Ensure idempotency: first format and second format are the same
17+
$ diff formatted.re formatted_back.re
18+

0 commit comments

Comments
 (0)