Skip to content

Commit 92ea1bd

Browse files
committed
more test fixes
1 parent a216f0d commit 92ea1bd

19 files changed

+461
-495
lines changed

jscomp/others/js_typed_array.res

Lines changed: 199 additions & 206 deletions
Large diffs are not rendered by default.

jscomp/test/gpr_4265_test.js

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

jscomp/test/gpr_4265_test.res

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,15 +5,15 @@ let eq = (loc, x, y) => Mt.eq_suites(~test_id, ~suites, loc, x, y)
55
open Belt
66
let mockMap = MutableMap.Int.make()
77
let add = id => {
8-
(mockMap->MutableMap.Int.set)(id, id)
8+
MutableMap.Int.set(mockMap, id, id)
99
id
1010
}
11-
let remove = id => (mockMap->MutableMap.Int.remove)(id)
11+
let remove = id => MutableMap.Int.remove(mockMap, id)
1212
let _ = add(1726)
1313
let n = add(6667)
1414
let _ = add(486)
1515
let _ = remove(1726)
16-
let n1 = (mockMap->MutableMap.Int.getExn)(6667)
16+
let n1 = MutableMap.Int.getExn(mockMap, 6667)
1717

1818
eq(__LOC__, n, n1)
1919

jscomp/test/hashtbl_test.js

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

jscomp/test/hashtbl_test.res

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ let f = () => {
66
let tbl = Hashtbl.create(17)
77
add(tbl, 1, '1')
88
add(tbl, 2, '2')
9-
\"@@"(List.sort(((a: int, _), (b, _)) => compare(a, b)), to_list(tbl))
9+
\"@@"(l => List.sort(((a: int, _), (b, _)) => compare(a, b), l), to_list(tbl))
1010
}
1111

1212
let g = count => {
@@ -18,7 +18,7 @@ let g = count => {
1818
replace(tbl, i * 2, string_of_int(i))
1919
}
2020
let v = to_list(tbl)
21-
let v = \"@@"(List.sort(((x, _), (y: int, _)) => compare(x, y)), v)
21+
let v = \"@@"(l => List.sort(((x, _), (y: int, _)) => compare(x, y), l), v)
2222
Array.of_list(v)
2323
}
2424

jscomp/test/inline_regression_test.js

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

jscomp/test/inline_regression_test.res

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,8 @@ let generic_basename = (is_dir_sep, current_dir_name, name) => {
2323
}
2424
}
2525

26-
let basename = generic_basename((s, i) => String.get(s, i) == '/', Filename.current_dir_name)
26+
let basename = l =>
27+
generic_basename((s, i) => String.get(s, i) == '/', Filename.current_dir_name, l)
2728

2829
let suites = {
2930
open Mt

jscomp/test/int32_test.js

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

jscomp/test/int64_mul_div_test.js

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

jscomp/test/int64_mul_div_test.res

Lines changed: 24 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -199,52 +199,45 @@ let simple_divs = [
199199
/* let f a b = a,b, div a b, rem a b;; */
200200

201201
let from = xs =>
202-
xs
203-
|> Array.to_list
204-
|> List.mapi((i, (a, b, c, d)) => (
205-
"small_divs " ++ __unsafe_cast(i),
206-
_ => Mt.Eq((c, d), (Int64.div(a, b), Int64.rem(a, b))),
207-
))
202+
List.mapi(
203+
(i, (a, b, c, d)) => (
204+
"small_divs " ++ __unsafe_cast(i),
205+
_ => Mt.Eq((c, d), (Int64.div(a, b), Int64.rem(a, b))),
206+
),
207+
Array.to_list(xs),
208+
)
208209
let to_string = [(0L, "0")]
209210

210211
let int64_compare_tests = [(1L, 2L, -1), (2L, 1L, 1), (2L, 1L, 1)]
211212

212213
let from_compare = xs =>
213-
xs
214-
|> Array.to_list
215-
|> List.mapi((i, (a, b, c)) => (
216-
"int64_compare " ++ __unsafe_cast(i),
217-
_ => Mt.Eq(c, Int64.compare(a, b)),
218-
))
214+
List.mapi(
215+
(i, (a, b, c)) => ("int64_compare " ++ __unsafe_cast(i), _ => Mt.Eq(c, Int64.compare(a, b))),
216+
Array.to_list(xs),
217+
)
219218

220219
let from_to_string = xs =>
221-
xs
222-
|> Array.to_list
223-
|> List.mapi((i, (a, str_a)) => (
224-
"to_string " ++ __unsafe_cast(i),
225-
_ => Mt.Eq(str_a, Int64.to_string(a)),
226-
))
220+
List.mapi(
221+
(i, (a, str_a)) => ("to_string " ++ __unsafe_cast(i), _ => Mt.Eq(str_a, Int64.to_string(a))),
222+
Array.to_list(xs),
223+
)
227224

228225
\"@@"(
229-
Mt.from_pair_suites(__MODULE__),
226+
l => Mt.from_pair_suites(__MODULE__, l),
230227
\"@"(
231228
from_pairs("random", pairs),
232229
\"@"(
233230
from_pairs("small", small_pairs),
234231
\"@"(
235-
to_floats
236-
|> Array.to_list
237-
|> List.mapi((i, (i64, f)) => (
238-
"to_float_" ++ __unsafe_cast(i),
239-
_ => Mt.Eq(Int64.to_float(i64), f),
240-
)),
232+
List.mapi(
233+
(i, (i64, f)) => ("to_float_" ++ __unsafe_cast(i), _ => Mt.Eq(Int64.to_float(i64), f)),
234+
Array.to_list(to_floats),
235+
),
241236
\"@"(
242-
of_float_pairs
243-
|> Array.to_list
244-
|> List.mapi((i, (f, i64)) => (
245-
"of_float_" ++ __unsafe_cast(i),
246-
_ => Mt.Eq(Int64.of_float(f), i64),
247-
)),
237+
List.mapi(
238+
(i, (f, i64)) => ("of_float_" ++ __unsafe_cast(i), _ => Mt.Eq(Int64.of_float(f), i64)),
239+
Array.to_list(of_float_pairs),
240+
),
248241
\"@"(
249242
list{
250243
(

0 commit comments

Comments
 (0)