Skip to content

Commit 1646b54

Browse files
committed
Test genType.
1 parent ae53771 commit 1646b54

File tree

5 files changed

+44
-25
lines changed

5 files changed

+44
-25
lines changed

bsconfig.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717
"module": "es6",
1818
"in-source": true
1919
},
20+
"gentypeconfig": {},
2021
"warnings": {
2122
"error": "+101"
2223
}

test/ArrayTests.gen.tsx

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
/* TypeScript file generated from ArrayTests.res by genType. */
2+
/* eslint-disable import/first */
3+
4+
5+
// @ts-ignore: Implicit any on import
6+
import * as ArrayTestsBS__Es6Import from './ArrayTests.mjs';
7+
const ArrayTestsBS: any = ArrayTestsBS__Es6Import;
8+
9+
export const a: number[] = ArrayTestsBS.a;

test/ArrayTests.mjs

Lines changed: 27 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -7,15 +7,17 @@ import * as Core__Array from "../src/Core__Array.mjs";
77

88
var eq = Caml_obj.equal;
99

10+
var a = Core__Array.make(6, 7);
11+
1012
Test.run([
1113
[
1214
"ArrayTests.res",
13-
5,
15+
8,
1416
20,
1517
26
1618
],
1719
"make"
18-
], Core__Array.make(6, 7), eq, [
20+
], a, eq, [
1921
7,
2022
7,
2123
7,
@@ -27,7 +29,7 @@ Test.run([
2729
Test.run([
2830
[
2931
"ArrayTests.res",
30-
8,
32+
11,
3133
13,
3234
30
3335
],
@@ -47,7 +49,7 @@ Test.run([
4749
Test.run([
4850
[
4951
"ArrayTests.res",
50-
14,
52+
17,
5153
20,
5254
28
5355
],
@@ -70,7 +72,7 @@ Test.run([
7072
Test.run([
7173
[
7274
"ArrayTests.res",
73-
15,
75+
18,
7476
20,
7577
36
7678
],
@@ -80,7 +82,7 @@ Test.run([
8082
Test.run([
8183
[
8284
"ArrayTests.res",
83-
18,
85+
21,
8486
13,
8587
30
8688
],
@@ -108,7 +110,7 @@ Test.run([
108110
Test.run([
109111
[
110112
"ArrayTests.res",
111-
24,
113+
27,
112114
13,
113115
38
114116
],
@@ -123,7 +125,7 @@ Test.run([
123125
Test.run([
124126
[
125127
"ArrayTests.res",
126-
31,
128+
34,
127129
13,
128130
26
129131
],
@@ -146,7 +148,7 @@ Test.run([
146148
Test.run([
147149
[
148150
"ArrayTests.res",
149-
36,
151+
39,
150152
20,
151153
41
152154
],
@@ -156,7 +158,7 @@ Test.run([
156158
Test.run([
157159
[
158160
"ArrayTests.res",
159-
39,
161+
42,
160162
13,
161163
35
162164
],
@@ -184,7 +186,7 @@ Test.run([
184186
Test.run([
185187
[
186188
"ArrayTests.res",
187-
45,
189+
48,
188190
13,
189191
38
190192
],
@@ -199,7 +201,7 @@ Test.run([
199201
Test.run([
200202
[
201203
"ArrayTests.res",
202-
51,
204+
54,
203205
20,
204206
38
205207
],
@@ -219,7 +221,7 @@ var arr = [
219221
Test.run([
220222
[
221223
"ArrayTests.res",
222-
54,
224+
57,
223225
13,
224226
38
225227
],
@@ -229,7 +231,7 @@ Test.run([
229231
Test.run([
230232
[
231233
"ArrayTests.res",
232-
65,
234+
68,
233235
13,
234236
24
235237
],
@@ -255,7 +257,7 @@ Test.run([
255257
Test.run([
256258
[
257259
"ArrayTests.res",
258-
70,
260+
73,
259261
20,
260262
42
261263
],
@@ -274,7 +276,7 @@ Test.run([
274276
Test.run([
275277
[
276278
"ArrayTests.res",
277-
72,
279+
75,
278280
13,
279281
32
280282
],
@@ -289,7 +291,7 @@ Test.run([
289291
Test.run([
290292
[
291293
"ArrayTests.res",
292-
78,
294+
81,
293295
20,
294296
30
295297
],
@@ -306,7 +308,7 @@ Test.run([
306308
Test.run([
307309
[
308310
"ArrayTests.res",
309-
80,
311+
83,
310312
13,
311313
34
312314
],
@@ -324,7 +326,7 @@ Test.run([
324326
Test.run([
325327
[
326328
"ArrayTests.res",
327-
85,
329+
88,
328330
20,
329331
41
330332
],
@@ -338,7 +340,7 @@ Test.run([
338340
Test.run([
339341
[
340342
"ArrayTests.res",
341-
86,
343+
89,
342344
20,
343345
38
344346
],
@@ -348,7 +350,7 @@ Test.run([
348350
Test.run([
349351
[
350352
"ArrayTests.res",
351-
89,
353+
92,
352354
13,
353355
22
354356
],
@@ -370,7 +372,7 @@ Test.run([
370372
Test.run([
371373
[
372374
"ArrayTests.res",
373-
94,
375+
97,
374376
20,
375377
40
376378
],
@@ -389,7 +391,7 @@ Test.run([
389391
Test.run([
390392
[
391393
"ArrayTests.res",
392-
96,
394+
99,
393395
13,
394396
30
395397
],
@@ -403,5 +405,6 @@ Test.run([
403405

404406
export {
405407
eq ,
408+
a ,
406409
}
407-
/* Not a pure module */
410+
/* a Not a pure module */

test/ArrayTests.res

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,10 @@ open RescriptCore
22

33
let eq = (a, b) => a == b
44

5-
Test.run(__POS_OF__("make"), Array.make(~length=6, 7), eq, [7, 7, 7, 7, 7, 7])
5+
@genType
6+
let a = Array.make(~length=6, 7)
7+
8+
Test.run(__POS_OF__("make"), a, eq, [7, 7, 7, 7, 7, 7])
69

710
Test.run(
811
__POS_OF__("fromInitializer"),

test/TestSuite.mjs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,8 @@ var Concurrently = PromiseTest.Concurrently;
2727

2828
var panicTest = ErrorTests.panicTest;
2929

30+
var a = ArrayTests.a;
31+
3032
var $$catch = IntTests.$$catch;
3133

3234
var eq = ResultTests.eq;
@@ -46,6 +48,7 @@ export {
4648
Catching ,
4749
Concurrently ,
4850
panicTest ,
51+
a ,
4952
$$catch ,
5053
eq ,
5154
forEachIfOkCallFunction ,

0 commit comments

Comments
 (0)