Skip to content

Commit 802e44f

Browse files
committed
caml_format_test
1 parent d9a7035 commit 802e44f

17 files changed

+125
-113
lines changed

jscomp/test/caml_format_test.js

Lines changed: 14 additions & 12 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

jscomp/test/caml_format_test.res

Lines changed: 44 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -26,12 +26,15 @@ let of_string = [
2626
/* "0.", 0. */
2727
/* |] */
2828

29-
let from_float_of_string = xs => xs |> Array.mapi((i, (a, b)) => string_of_float)
29+
let from_float_of_string = xs => Array.mapi((i, (a, b)) => string_of_float, xs)
3030

3131
let from_of_string = xs =>
32-
of_string
33-
|> Array.mapi((i, (a, b)) => (`of_string ${string_of_int(i)}`, _ => Mt.Eq(int_of_string(b), a)))
34-
|> Array.to_list
32+
Array.to_list(
33+
Array.mapi(
34+
(i, (a, b)) => (`of_string ${string_of_int(i)}`, _ => Mt.Eq(int_of_string(b), a)),
35+
of_string,
36+
),
37+
)
3538

3639
let to_str = s => int_of_string(s)
3740

@@ -51,12 +54,15 @@ let suites: Mt.pair_suites = \"@"(
5154
(FP_zero, "0."),
5255
]
5356

54-
pairs
55-
|> Array.mapi((i, (a, b)) => (
56-
`infinity_of_string ${string_of_int(i)}`,
57-
_ => Mt.Eq(a, \"@@"(classify_float, float_of_string(b))),
58-
))
59-
|> Array.to_list
57+
Array.to_list(
58+
Array.mapi(
59+
(i, (a, b)) => (
60+
`infinity_of_string ${string_of_int(i)}`,
61+
_ => Mt.Eq(a, \"@@"(classify_float, float_of_string(b))),
62+
),
63+
pairs,
64+
),
65+
)
6066
},
6167
\"@"(
6268
list{
@@ -66,19 +72,22 @@ let suites: Mt.pair_suites = \"@"(
6672
{
6773
let pairs = [(3232., "32_32.0"), (1.000, "1.000"), (12.000, "12.000")]
6874

69-
pairs
70-
|> Array.mapi((i, (a, b)) => (
71-
`normal_float_of_string ${string_of_int(i)}`,
72-
_ => Mt.Eq(a, float_of_string(b)),
73-
))
74-
|> Array.to_list
75+
Array.to_list(
76+
Array.mapi(
77+
(i, (a, b)) => (
78+
`normal_float_of_string ${string_of_int(i)}`,
79+
_ => Mt.Eq(a, float_of_string(b)),
80+
),
81+
pairs,
82+
),
83+
)
7584
},
7685
),
7786
),
7887
),
7988
)
8089

81-
let ff = format_int("%32d")
90+
let ff = l => format_int("%32d", l)
8291

8392
external format_float: (string, float) => string = "?format_float"
8493

@@ -142,25 +151,30 @@ let of_string_data = [
142151
/* module Mt = Mock_mt */
143152

144153
let () = \"@@"(
145-
Mt.from_pair_suites(__MODULE__),
154+
l => Mt.from_pair_suites(__MODULE__, l),
146155
\"@"(
147156
suites,
148157
\"@"(
149-
Array.mapi(
150-
(i, (fmt, f, str_result)) => (
151-
`loat_format ${string_of_int(i)}`,
152-
_ => Mt.Eq(format_float(fmt, f), str_result),
158+
Array.to_list(
159+
Array.mapi(
160+
(i, (fmt, f, str_result)) => (
161+
`loat_format ${string_of_int(i)}`,
162+
_ => Mt.Eq(format_float(fmt, f), str_result),
163+
),
164+
float_data,
153165
),
154-
float_data,
155-
) |> Array.to_list,
166+
),
156167
\"@"(
157168
int64_suites,
158-
of_string_data
159-
|> Array.mapi((i, (a, b)) => (
160-
`int64_of_string ${string_of_int(i)} `,
161-
_ => Mt.Eq(Int64.of_string(b), a),
162-
))
163-
|> Array.to_list,
169+
Array.to_list(
170+
Array.mapi(
171+
(i, (a, b)) => (
172+
`int64_of_string ${string_of_int(i)} `,
173+
_ => Mt.Eq(Int64.of_string(b), a),
174+
),
175+
of_string_data,
176+
),
177+
),
164178
),
165179
),
166180
),

jscomp/test/earger_curry_test.js

Lines changed: 22 additions & 25 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

jscomp/test/earger_curry_test.res

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -134,10 +134,10 @@ let g = x => {
134134
}
135135
let a = f(0)(3, 4)
136136

137-
let b = f(0, 3, 5)
137+
let b = f(0)(3, 5)
138138

139-
let c = g(0, 3, 4)
140-
let d = g(0, 3, 5)
139+
let c = g(0)(3, 4)
140+
let d = g(0)(3, 5)
141141

142142
let () = {
143143
eq(__LOC__, a, 10)

jscomp/test/equal_box_test.js

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

jscomp/test/equal_exception_test.js

Lines changed: 3 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

jscomp/test/es6_module_test.js

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)