diff --git a/CHANGELOG.md b/CHANGELOG.md index cdb80445a6..a1912252a7 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -30,6 +30,7 @@ - Remove redundant space for export in generated js code. https://github.com/rescript-lang/rescript-compiler/pull/6560 - Remove empty export blocks in generated js code. https://github.com/rescript-lang/rescript-compiler/pull/6744 - Fix indent for returned/thrown/wrapped in parentheses objects in generated js code. https://github.com/rescript-lang/rescript-compiler/pull/6746 +- Fix indent in generated js code. https://github.com/rescript-lang/rescript-compiler/pull/6747 # 11.1.0 diff --git a/jscomp/core/js_dump.ml b/jscomp/core/js_dump.ml index 9925968f62..d443253dfa 100644 --- a/jscomp/core/js_dump.ml +++ b/jscomp/core/js_dump.ml @@ -393,7 +393,7 @@ and pp_function ~return_unit ~async ~is_method cxt (f : P.t) ~fn_state param_body () | No_name { single_arg } -> (* see # 1692, add a paren for annoymous function for safety *) - P.cond_paren_group f (not single_arg) 1 (fun _ -> + P.cond_paren_group f (not single_arg) (fun _ -> P.string f (L.function_async ~async); P.space f; param_body ()) @@ -526,7 +526,7 @@ and expression_desc cxt ~(level : int) f x : cxt = bool f b; cxt | Seq (e1, e2) -> - P.cond_paren_group f (level > 0) 1 (fun () -> + P.cond_paren_group f (level > 0) (fun () -> let cxt = expression ~level:0 cxt f e1 in comma_sp f; expression ~level:0 cxt f e2) @@ -544,12 +544,12 @@ and expression_desc cxt ~(level : int) f x : cxt = ]} *) | Call (e, el, info) -> - P.cond_paren_group f (level > 15) 1 (fun _ -> - P.group f 1 (fun _ -> + P.cond_paren_group f (level > 15) (fun _ -> + P.group f 0 (fun _ -> match (info, el) with | { arity = Full }, _ | _, [] -> let cxt = expression ~level:15 cxt f e in - P.paren_group f 1 (fun _ -> + P.paren_group f 0 (fun _ -> match el with | [ { @@ -580,13 +580,13 @@ and expression_desc cxt ~(level : int) f x : cxt = let len = List.length el in if 1 <= len && len <= 8 then ( Curry_gen.pp_app f len; - P.paren_group f 1 (fun _ -> arguments cxt f (e :: el))) + P.paren_group f 0 (fun _ -> arguments cxt f (e :: el))) else ( Curry_gen.pp_app_any f; - P.paren_group f 1 (fun _ -> + P.paren_group f 0 (fun _ -> arguments cxt f [ e; E.array Mutable el ])))) | FlatCall (e, el) -> - P.group f 1 (fun _ -> + P.group f 0 (fun _ -> let cxt = expression ~level:15 cxt f e in P.string f L.dot; P.string f L.apply; @@ -676,7 +676,7 @@ and expression_desc cxt ~(level : int) f x : cxt = if need_paren then P.paren f action else action (); cxt | Is_null_or_undefined e -> - P.cond_paren_group f (level > 0) 1 (fun _ -> + P.cond_paren_group f (level > 0) (fun _ -> let cxt = expression ~level:1 cxt f e in P.space f; P.string f "=="; @@ -684,7 +684,7 @@ and expression_desc cxt ~(level : int) f x : cxt = P.string f L.null; cxt) | Js_not e -> - P.cond_paren_group f (level > 13) 1 (fun _ -> + P.cond_paren_group f (level > 13) (fun _ -> P.string f "!"; expression ~level:13 cxt f e) | Typeof e -> @@ -704,7 +704,7 @@ and expression_desc cxt ~(level : int) f x : cxt = {[ 0.00 - x ]} {[ 0.000 - x ]} *) -> - P.cond_paren_group f (level > 13) 1 (fun _ -> + P.cond_paren_group f (level > 13) (fun _ -> P.string f (match desc with Float _ -> "- " | _ -> "-"); expression ~level:13 cxt f e) | Bin (op, e1, e2) -> @@ -714,7 +714,7 @@ and expression_desc cxt ~(level : int) f x : cxt = in (* We are more conservative here, to make the generated code more readable to the user *) - P.cond_paren_group f need_paren 1 (fun _ -> + P.cond_paren_group f need_paren (fun _ -> let cxt = expression ~level:lft cxt f e1 in P.space f; P.string f (Js_op_util.op_str op); @@ -726,7 +726,7 @@ and expression_desc cxt ~(level : int) f x : cxt = let need_paren = level > out || match op with Lsl | Lsr | Asr -> true | _ -> false in - P.cond_paren_group f need_paren 1 (fun _ -> + P.cond_paren_group f need_paren (fun _ -> let cxt = expression ~level:lft cxt f e1 in P.space f; P.string f "+"; @@ -862,12 +862,12 @@ and expression_desc cxt ~(level : int) f x : cxt = P.string f tag; cxt) | Array_index (e, p) -> - P.cond_paren_group f (level > 15) 1 (fun _ -> + P.cond_paren_group f (level > 15) (fun _ -> P.group f 1 (fun _ -> let cxt = expression ~level:15 cxt f e in P.bracket_group f 1 (fun _ -> expression ~level:0 cxt f p))) | Static_index (e, s, _) -> - P.cond_paren_group f (level > 15) 1 (fun _ -> + P.cond_paren_group f (level > 15) (fun _ -> let cxt = expression ~level:15 cxt f e in Js_dump_property.property_access f s; (* See [ .obj_of_exports] @@ -877,13 +877,13 @@ and expression_desc cxt ~(level : int) f x : cxt = cxt) | Length (e, _) -> (*Todo: check parens *) - P.cond_paren_group f (level > 15) 1 (fun _ -> + P.cond_paren_group f (level > 15) (fun _ -> let cxt = expression ~level:15 cxt f e in P.string f L.dot; P.string f L.length; cxt) | New (e, el) -> - P.cond_paren_group f (level > 15) 1 (fun _ -> + P.cond_paren_group f (level > 15) (fun _ -> P.group f 1 (fun _ -> P.string f L.new_; P.space f; @@ -916,14 +916,14 @@ and expression_desc cxt ~(level : int) f x : cxt = var f = { x : 2 , y : 2} ]} *) - P.cond_paren_group f (level > 1) 0 (fun _ -> + P.cond_paren_group f (level > 1) (fun _ -> if lst = [] then ( P.string f "{}"; cxt) else P.brace_vgroup f 1 (fun _ -> property_name_and_value_list cxt f lst)) | Await e -> - P.cond_paren_group f (level > 13) 1 (fun _ -> + P.cond_paren_group f (level > 13) (fun _ -> P.string f "await "; expression ~level:13 cxt f e) diff --git a/jscomp/ext/ext_pp.ml b/jscomp/ext/ext_pp.ml index 7ac0502682..5b1e4a8b02 100644 --- a/jscomp/ext/ext_pp.ml +++ b/jscomp/ext/ext_pp.ml @@ -160,8 +160,8 @@ let paren_vgroup st n action = let paren_group st n action = group st n (fun _ -> paren st action) -let cond_paren_group st b n action = - if b then paren_group st n action else action () +let cond_paren_group st b action = + if b then paren_group st 0 action else action () let brace_group st n action = group st n (fun _ -> brace st action) diff --git a/jscomp/ext/ext_pp.mli b/jscomp/ext/ext_pp.mli index 6db5327aa5..aaf2176214 100644 --- a/jscomp/ext/ext_pp.mli +++ b/jscomp/ext/ext_pp.mli @@ -56,7 +56,7 @@ val brace : t -> (unit -> 'a) -> 'a val paren_group : t -> int -> (unit -> 'a) -> 'a -val cond_paren_group : t -> bool -> int -> (unit -> 'a) -> 'a +val cond_paren_group : t -> bool -> (unit -> 'a) -> 'a val paren_vgroup : t -> int -> (unit -> 'a) -> 'a diff --git a/jscomp/test/406_primitive_test.js b/jscomp/test/406_primitive_test.js index 16bc48c89f..0174788769 100644 --- a/jscomp/test/406_primitive_test.js +++ b/jscomp/test/406_primitive_test.js @@ -25,9 +25,9 @@ var backend_type = { }; eq("File \"406_primitive_test.res\", line 23, characters 3-10", backend_type, { - TAG: "Other", - _0: "BS" - }); + TAG: "Other", + _0: "BS" +}); function f(param) { var A = /* @__PURE__ */Caml_exceptions.create("A"); diff --git a/jscomp/test/Import.js b/jscomp/test/Import.js index 756f4e22ac..f7fc79a43b 100644 --- a/jscomp/test/Import.js +++ b/jscomp/test/Import.js @@ -5,14 +5,14 @@ var Curry = require("../../lib/js/curry.js"); async function eachIntAsync(list, f) { return Curry._2(await import("../../lib/js/belt_List.js").then(function (m) { - return m.forEach; - }), list, f); + return m.forEach; + }), list, f); } function eachIntLazy(list, f) { var obj = import("../../lib/js/belt_List.js").then(function (m) { - return m.forEach; - }); + return m.forEach; + }); var arg1 = function (each) { return Promise.resolve(Curry._2(each, list, f)); }; @@ -20,30 +20,30 @@ function eachIntLazy(list, f) { } eachIntLazy({ - hd: 1, - tl: { - hd: 2, - tl: { - hd: 3, - tl: /* [] */0 - } - } - }, (function (n) { - console.log("lazy", n); - })); + hd: 1, + tl: { + hd: 2, + tl: { + hd: 3, + tl: /* [] */0 + } + } +}, (function (n) { + console.log("lazy", n); +})); eachIntAsync({ - hd: 1, - tl: { - hd: 2, - tl: { - hd: 3, - tl: /* [] */0 - } - } - }, (function (n) { - console.log("async", n); - })); + hd: 1, + tl: { + hd: 2, + tl: { + hd: 3, + tl: /* [] */0 + } + } +}, (function (n) { + console.log("async", n); +})); var beltAsModule = await import("../../lib/js/belt_List.js"); diff --git a/jscomp/test/SafePromises.js b/jscomp/test/SafePromises.js index 8e6e7fa6fe..8853a997cb 100644 --- a/jscomp/test/SafePromises.js +++ b/jscomp/test/SafePromises.js @@ -6,12 +6,12 @@ var Js_promise2 = require("../../lib/js/js_promise2.js"); async function nestedPromise(xxx) { var xx = await xxx; Js_promise2.then(xx, (function (x) { - return Promise.resolve((console.log("Promise2.then", x), undefined)); - })); + return Promise.resolve((console.log("Promise2.then", x), undefined)); + })); Js_promise2.$$catch(xx, (function (x) { - console.log("Promise2.catch_", x); - return Promise.resolve(0); - })); + console.log("Promise2.catch_", x); + return Promise.resolve(0); + })); var arg1 = function (x) { return Promise.resolve((console.log("Promise.then_", x), undefined)); }; diff --git a/jscomp/test/UncurriedAlways.js b/jscomp/test/UncurriedAlways.js index 3998114976..3474f9929d 100644 --- a/jscomp/test/UncurriedAlways.js +++ b/jscomp/test/UncurriedAlways.js @@ -21,8 +21,8 @@ var a = 7; console.log(a); [1].map(function (x) { - return x + 1 | 0; - }); + return x + 1 | 0; +}); function ptl(extra) { return 10 + extra | 0; @@ -163,11 +163,11 @@ function fn(cb) { } ((function (s) { - console.log({ - NAME: "foo", - VAL: s - }); - })()); + console.log({ + NAME: "foo", + VAL: s + }); + })()); function fn1(a, b, param) { return a() + b | 0; @@ -175,8 +175,8 @@ function fn1(a, b, param) { function a$1(__x) { return fn1((function () { - return 1; - }), 2, __x); + return 1; + }), 2, __x); } function f3(x, y, z) { diff --git a/jscomp/test/UncurriedExternals.js b/jscomp/test/UncurriedExternals.js index ec16af52e4..5bfc1b5311 100644 --- a/jscomp/test/UncurriedExternals.js +++ b/jscomp/test/UncurriedExternals.js @@ -14,8 +14,8 @@ var h = sum(1.0, 2.0); var M = { sum: (function (prim0, prim1) { - return sum(prim0, prim1); - }) + return sum(prim0, prim1); + }) }; var hh = M.sum(1.0, 2.0); @@ -36,21 +36,21 @@ var tcr = {}; function tsiC(c) { c.increment = (function (amount) { - var me = this ; - console.log(me); - }); + var me = this ; + console.log(me); + }); } function tsiU(c) { c.increment = (function (amount) { - var me = this ; - console.log(me); - }); + var me = this ; + console.log(me); + }); } var match = React.useState(function (param) { - return 3; - }); + return 3; +}); var StandardNotation_get = match[0]; @@ -75,8 +75,8 @@ var StandardNotation = { function methodWithAsync(param) { var $$this = this ; return (async function (arg) { - return $$this + arg | 0; - })(param); + return $$this + arg | 0; + })(param); } function dd$1(param) { @@ -90,8 +90,8 @@ var h$1 = sum(1.0, 2.0); var M$1 = { sum: (function (prim0, prim1) { - return sum(prim0, prim1); - }) + return sum(prim0, prim1); + }) }; var hh$1 = M$1.sum(1.0, 2.0); @@ -112,21 +112,21 @@ var tcr$1 = {}; function tsiC$1(c) { c.increment = (function (amount) { - var me = this ; - console.log(me); - }); + var me = this ; + console.log(me); + }); } function tsiU$1(c) { c.increment = (function (amount) { - var me = this ; - console.log(me); - }); + var me = this ; + console.log(me); + }); } var match$1 = React.useState(function () { - return 3; - }); + return 3; +}); function methodWithAsyncU() { var $$this = this ; diff --git a/jscomp/test/UntaggedVariants.js b/jscomp/test/UntaggedVariants.js index a856c00f62..a711a227aa 100644 --- a/jscomp/test/UntaggedVariants.js +++ b/jscomp/test/UntaggedVariants.js @@ -378,8 +378,8 @@ function classify$9(v) { } var ff = (function (x) { - return x + 1 | 0; - }); + return x + 1 | 0; +}); var TestFunctionCase = { classify: classify$9, @@ -501,8 +501,8 @@ async function classify$10(a) { } else { if (Array.isArray(a)) { console.log(function (param) { - return Belt_Array.joinWith(a, "-", param); - }); + return Belt_Array.joinWith(a, "-", param); + }); return; } if (a instanceof Promise) { @@ -528,8 +528,8 @@ var Arr = { async function classifyAll(t) { if (Array.isArray(t)) { console.log(function (param) { - return Belt_Array.joinWith(t, "-", param); - }); + return Belt_Array.joinWith(t, "-", param); + }); return; } if (t instanceof Promise) { diff --git a/jscomp/test/a_filename_test.js b/jscomp/test/a_filename_test.js index ebf92f1c18..c02e4e8f4c 100644 --- a/jscomp/test/a_filename_test.js +++ b/jscomp/test/a_filename_test.js @@ -19,12 +19,12 @@ function eq(loc, x, y) { hd: [ loc + (" id " + String(test_id.contents)), (function (param) { - return { - TAG: "Eq", - _0: x, - _1: y - }; - }) + return { + TAG: "Eq", + _0: x, + _1: y + }; + }) ], tl: suites.contents }; @@ -36,89 +36,89 @@ function test(param, param$1) { if (process.platform !== "win32") { eq("File \"a_filename_test.res\", line 16, characters 4-11", [ - Ext_filename_test.combine("/tmp", "subdir/file.txt"), - Ext_filename_test.combine("/tmp", "/a/tmp.txt"), - Ext_filename_test.combine("/a/tmp.txt", "subdir/file.txt") - ], [ - "/tmp/subdir/file.txt", - "/a/tmp.txt", - "/a/tmp.txt/subdir/file.txt" - ]); + Ext_filename_test.combine("/tmp", "subdir/file.txt"), + Ext_filename_test.combine("/tmp", "/a/tmp.txt"), + Ext_filename_test.combine("/a/tmp.txt", "subdir/file.txt") + ], [ + "/tmp/subdir/file.txt", + "/a/tmp.txt", + "/a/tmp.txt/subdir/file.txt" + ]); eq("File \"a_filename_test.res\", line 28, characters 5-12", Ext_filename_test.node_relative_path(true, { - NAME: "File", - VAL: "./a/b.c" - }, { - NAME: "File", - VAL: "./a/u/g.c" - }), "./u/g.c"); + NAME: "File", + VAL: "./a/b.c" + }, { + NAME: "File", + VAL: "./a/u/g.c" + }), "./u/g.c"); eq("File \"a_filename_test.res\", line 31, characters 4-11", Ext_filename_test.node_relative_path(true, { - NAME: "File", - VAL: "./a/b.c" - }, { - NAME: "File", - VAL: "xxxghsoghos/ghsoghso/node_modules/buckle-stdlib/list.js" - }), "buckle-stdlib/list.js"); + NAME: "File", + VAL: "./a/b.c" + }, { + NAME: "File", + VAL: "xxxghsoghos/ghsoghso/node_modules/buckle-stdlib/list.js" + }), "buckle-stdlib/list.js"); eq("File \"a_filename_test.res\", line 37, characters 4-11", Ext_filename_test.node_relative_path(true, { - NAME: "File", - VAL: "./a/b.c" - }, { - NAME: "File", - VAL: "xxxghsoghos/ghsoghso/node_modules//buckle-stdlib/list.js" - }), "buckle-stdlib/list.js"); + NAME: "File", + VAL: "./a/b.c" + }, { + NAME: "File", + VAL: "xxxghsoghos/ghsoghso/node_modules//buckle-stdlib/list.js" + }), "buckle-stdlib/list.js"); eq("File \"a_filename_test.res\", line 43, characters 4-11", Ext_filename_test.node_relative_path(true, { - NAME: "File", - VAL: "./a/b.c" - }, { - NAME: "File", - VAL: "xxxghsoghos/ghsoghso/node_modules/./buckle-stdlib/list.js" - }), "buckle-stdlib/list.js"); + NAME: "File", + VAL: "./a/b.c" + }, { + NAME: "File", + VAL: "xxxghsoghos/ghsoghso/node_modules/./buckle-stdlib/list.js" + }), "buckle-stdlib/list.js"); eq("File \"a_filename_test.res\", line 48, characters 5-12", Ext_filename_test.node_relative_path(true, { - NAME: "File", - VAL: "./a/c.js" - }, { - NAME: "File", - VAL: "./a/b" - }), "./b"); + NAME: "File", + VAL: "./a/c.js" + }, { + NAME: "File", + VAL: "./a/b" + }), "./b"); eq("File \"a_filename_test.res\", line 49, characters 5-12", Ext_filename_test.node_relative_path(true, { - NAME: "File", - VAL: "./a/c" - }, { - NAME: "File", - VAL: "./a/b.js" - }), "./b.js"); + NAME: "File", + VAL: "./a/c" + }, { + NAME: "File", + VAL: "./a/b.js" + }), "./b.js"); eq("File \"a_filename_test.res\", line 50, characters 5-12", Ext_filename_test.node_relative_path(true, { - NAME: "Dir", - VAL: "./a/" - }, { - NAME: "File", - VAL: "./a/b.js" - }), "./b.js"); + NAME: "Dir", + VAL: "./a/" + }, { + NAME: "File", + VAL: "./a/b.js" + }), "./b.js"); eq("File \"a_filename_test.res\", line 51, characters 5-12", Ext_filename_test.get_extension("a.txt"), ".txt"); eq("File \"a_filename_test.res\", line 52, characters 5-12", Ext_filename_test.get_extension("a"), ""); eq("File \"a_filename_test.res\", line 53, characters 5-12", Ext_filename_test.get_extension(".txt"), ".txt"); eq("File \"a_filename_test.res\", line 56, characters 4-11", $$Array.map(Ext_filename_test.normalize_absolute_path, [ - "/gsho/./..", - "/a/b/../c../d/e/f", - "/a/b/../c/../d/e/f", - "/gsho/./../..", - "/a/b/c/d", - "/a/b/c/d/", - "/a/", - "/a", - "/a.txt/", - "/a.txt" - ]), [ - "/", - "/a/c../d/e/f", - "/a/d/e/f", - "/", - "/a/b/c/d", - "/a/b/c/d", - "/a", - "/a", - "/a.txt", - "/a.txt" - ]); + "/gsho/./..", + "/a/b/../c../d/e/f", + "/a/b/../c/../d/e/f", + "/gsho/./../..", + "/a/b/c/d", + "/a/b/c/d/", + "/a/", + "/a", + "/a.txt/", + "/a.txt" + ]), [ + "/", + "/a/c../d/e/f", + "/a/d/e/f", + "/", + "/a/b/c/d", + "/a/b/c/d", + "/a", + "/a", + "/a.txt", + "/a.txt" + ]); } Mt.from_pair_suites("A_filename_test", suites.contents); diff --git a/jscomp/test/a_list_test.js b/jscomp/test/a_list_test.js index 106bb9547f..3b6697de30 100644 --- a/jscomp/test/a_list_test.js +++ b/jscomp/test/a_list_test.js @@ -7,98 +7,98 @@ var Ext_list_test = require("./ext_list_test.js"); var suites_0 = [ "drop", (function (param) { - return { - TAG: "Eq", - _0: Ext_list_test.drop(3, { - hd: 0, - tl: { - hd: 1, - tl: { - hd: 2, - tl: /* [] */0 - } - } - }), - _1: /* [] */0 - }; - }) + return { + TAG: "Eq", + _0: Ext_list_test.drop(3, { + hd: 0, + tl: { + hd: 1, + tl: { + hd: 2, + tl: /* [] */0 + } + } + }), + _1: /* [] */0 + }; + }) ]; var suites_1 = { hd: [ "drop1", (function (param) { - return { - TAG: "Eq", - _0: Ext_list_test.drop(2, { - hd: 0, - tl: { - hd: 1, - tl: { - hd: 2, - tl: /* [] */0 - } - } - }), - _1: { - hd: 2, - tl: /* [] */0 + return { + TAG: "Eq", + _0: Ext_list_test.drop(2, { + hd: 0, + tl: { + hd: 1, + tl: { + hd: 2, + tl: /* [] */0 + } } - }; - }) + }), + _1: { + hd: 2, + tl: /* [] */0 + } + }; + }) ], tl: { hd: [ "flat_map", (function (param) { - return { - TAG: "Eq", - _0: { + return { + TAG: "Eq", + _0: { + hd: 0, + tl: { hd: 0, tl: { - hd: 0, + hd: 1, tl: { hd: 1, tl: { - hd: 1, - tl: { - hd: 0, - tl: /* [] */0 - } + hd: 0, + tl: /* [] */0 } } } - }, - _1: Ext_list_test.flat_map((function (x) { - if (x % 2 === 0) { - return { - hd: 0, - tl: /* [] */0 - }; - } else { - return { - hd: 1, - tl: { - hd: 1, - tl: /* [] */0 - } - }; - } - }), { + } + }, + _1: Ext_list_test.flat_map((function (x) { + if (x % 2 === 0) { + return { + hd: 0, + tl: /* [] */0 + }; + } else { + return { + hd: 1, + tl: { + hd: 1, + tl: /* [] */0 + } + }; + } + }), { + hd: 0, + tl: { + hd: 0, + tl: { + hd: 3, + tl: { hd: 0, - tl: { - hd: 0, - tl: { - hd: 3, - tl: { - hd: 0, - tl: /* [] */0 - } - } - } - }) - }; - }) + tl: /* [] */0 + } + } + } + }) + }; + }) ], tl: /* [] */0 } diff --git a/jscomp/test/a_recursive_type.js b/jscomp/test/a_recursive_type.js index 5f102e5805..194921d99b 100644 --- a/jscomp/test/a_recursive_type.js +++ b/jscomp/test/a_recursive_type.js @@ -8,9 +8,9 @@ function g(x) { } var loop = g({ - TAG: "A", - _0: g - }); + TAG: "A", + _0: g +}); var x = { TAG: "A", diff --git a/jscomp/test/a_string_test.js b/jscomp/test/a_string_test.js index e66cec47a7..8d20dfabbf 100644 --- a/jscomp/test/a_string_test.js +++ b/jscomp/test/a_string_test.js @@ -8,101 +8,101 @@ var Ext_string_test = require("./ext_string_test.js"); var suites_0 = [ "split", (function (param) { - return { - TAG: "Eq", - _0: Ext_string_test.split(true, "hihi", /* 'i' */105), - _1: { + return { + TAG: "Eq", + _0: Ext_string_test.split(true, "hihi", /* 'i' */105), + _1: { + hd: "h", + tl: { hd: "h", tl: { - hd: "h", - tl: { - hd: "", - tl: /* [] */0 - } + hd: "", + tl: /* [] */0 } } - }; - }) + } + }; + }) ]; var suites_1 = { hd: [ "split_non_empty", (function (param) { - return { - TAG: "Eq", - _0: Ext_string_test.split(undefined, "hihi", /* 'i' */105), - _1: { + return { + TAG: "Eq", + _0: Ext_string_test.split(undefined, "hihi", /* 'i' */105), + _1: { + hd: "h", + tl: { hd: "h", - tl: { - hd: "h", - tl: /* [] */0 - } + tl: /* [] */0 } - }; - }) + } + }; + }) ], tl: { hd: [ "split_empty", (function (param) { - return { - TAG: "Eq", - _0: Ext_string_test.split(true, "", /* 'i' */105), - _1: /* [] */0 - }; - }) + return { + TAG: "Eq", + _0: Ext_string_test.split(true, "", /* 'i' */105), + _1: /* [] */0 + }; + }) ], tl: { hd: [ "split_normal", (function (param) { - return { - TAG: "Eq", - _0: Ext_string_test.split(true, "h i i", /* ' ' */32), - _1: { - hd: "h", + return { + TAG: "Eq", + _0: Ext_string_test.split(true, "h i i", /* ' ' */32), + _1: { + hd: "h", + tl: { + hd: "i", tl: { hd: "i", - tl: { - hd: "i", - tl: /* [] */0 - } + tl: /* [] */0 } } - }; - }) + } + }; + }) ], tl: { hd: [ "split_by", (function (param) { - return { - TAG: "Eq", - _0: List.filter(function (s) { - return s !== ""; - })(Ext_string_test.split_by(undefined, (function (x) { - if (x === /* ' ' */32) { - return true; - } else { - return x === /* '\t' */9; - } - }), "h hgso hgso \t hi")), - _1: { - hd: "h", + return { + TAG: "Eq", + _0: List.filter(function (s) { + return s !== ""; + })(Ext_string_test.split_by(undefined, (function (x) { + if (x === /* ' ' */32) { + return true; + } else { + return x === /* '\t' */9; + } + }), "h hgso hgso \t hi")), + _1: { + hd: "h", + tl: { + hd: "hgso", tl: { hd: "hgso", tl: { - hd: "hgso", - tl: { - hd: "hi", - tl: /* [] */0 - } + hd: "hi", + tl: /* [] */0 } } } - }; - }) + } + }; + }) ], tl: /* [] */0 } diff --git a/jscomp/test/and_or_tailcall_test.js b/jscomp/test/and_or_tailcall_test.js index c77a08e9f8..14799848d6 100644 --- a/jscomp/test/and_or_tailcall_test.js +++ b/jscomp/test/and_or_tailcall_test.js @@ -34,24 +34,24 @@ function or_f(b, x, _n) { var suites_0 = [ "and_tail", (function (param) { - return { - TAG: "Eq", - _0: false, - _1: f(true, 1, 0) - }; - }) + return { + TAG: "Eq", + _0: false, + _1: f(true, 1, 0) + }; + }) ]; var suites_1 = { hd: [ "or_tail", (function (param) { - return { - TAG: "Eq", - _0: false, - _1: or_f(false, 1, 0) - }; - }) + return { + TAG: "Eq", + _0: false, + _1: or_f(false, 1, 0) + }; + }) ], tl: /* [] */0 }; diff --git a/jscomp/test/argv_test.js b/jscomp/test/argv_test.js index ddb4143b32..8d939ad3ae 100644 --- a/jscomp/test/argv_test.js +++ b/jscomp/test/argv_test.js @@ -44,10 +44,10 @@ var arg_spec = { }; Arg.parse_argv(undefined, [ - "prog.exe", - "-c", - "-d" - ], arg_spec, anno_fun, usage_msg); + "prog.exe", + "-c", + "-d" +], arg_spec, anno_fun, usage_msg); if (compile.contents !== true) { throw { diff --git a/jscomp/test/ari_regress_test.js b/jscomp/test/ari_regress_test.js index c798666753..1917447aae 100644 --- a/jscomp/test/ari_regress_test.js +++ b/jscomp/test/ari_regress_test.js @@ -31,46 +31,46 @@ function v(param) { var suites_0 = [ "curry", (function (param) { - return { - TAG: "Eq", - _0: g, - _1: 7 - }; - }) + return { + TAG: "Eq", + _0: g, + _1: 7 + }; + }) ]; var suites_1 = { hd: [ "curry2", (function (param) { - return { - TAG: "Eq", - _0: 14, - _1: (Curry._1(v, 1), Curry._1(v, 1)) - }; - }) + return { + TAG: "Eq", + _0: 14, + _1: (Curry._1(v, 1), Curry._1(v, 1)) + }; + }) ], tl: { hd: [ "curry3", (function (param) { - return { - TAG: "Eq", - _0: x, - _1: 14 - }; - }) + return { + TAG: "Eq", + _0: x, + _1: 14 + }; + }) ], tl: { hd: [ "File \"ari_regress_test.res\", line 35, characters 5-12", (function (param) { - return { - TAG: "Eq", - _0: h.contents, - _1: 1 - }; - }) + return { + TAG: "Eq", + _0: h.contents, + _1: 1 + }; + }) ], tl: /* [] */0 } diff --git a/jscomp/test/arith_parser.js b/jscomp/test/arith_parser.js index 58d71d866e..2a18696a6b 100644 --- a/jscomp/test/arith_parser.js +++ b/jscomp/test/arith_parser.js @@ -140,82 +140,82 @@ var yynames_block = "\ var yyact = [ (function (param) { - throw { - RE_EXN_ID: "Failure", - _1: "parser", - Error: new Error() - }; - }), + throw { + RE_EXN_ID: "Failure", + _1: "parser", + Error: new Error() + }; + }), (function (__caml_parser_env) { - return Parsing.peek_val(__caml_parser_env, 1); - }), + return Parsing.peek_val(__caml_parser_env, 1); + }), (function (__caml_parser_env) { - var _1 = Parsing.peek_val(__caml_parser_env, 0); - return { - TAG: "Numeral", - _0: _1 - }; - }), + var _1 = Parsing.peek_val(__caml_parser_env, 0); + return { + TAG: "Numeral", + _0: _1 + }; + }), (function (__caml_parser_env) { - var _1 = Parsing.peek_val(__caml_parser_env, 0); - return { - TAG: "Variable", - _0: _1 - }; - }), + var _1 = Parsing.peek_val(__caml_parser_env, 0); + return { + TAG: "Variable", + _0: _1 + }; + }), (function (__caml_parser_env) { - var _1 = Parsing.peek_val(__caml_parser_env, 2); - var _3 = Parsing.peek_val(__caml_parser_env, 0); - return { - TAG: "Plus", - _0: _1, - _1: _3 - }; - }), + var _1 = Parsing.peek_val(__caml_parser_env, 2); + var _3 = Parsing.peek_val(__caml_parser_env, 0); + return { + TAG: "Plus", + _0: _1, + _1: _3 + }; + }), (function (__caml_parser_env) { - var _1 = Parsing.peek_val(__caml_parser_env, 2); - var _3 = Parsing.peek_val(__caml_parser_env, 0); - return { - TAG: "Minus", - _0: _1, - _1: _3 - }; - }), + var _1 = Parsing.peek_val(__caml_parser_env, 2); + var _3 = Parsing.peek_val(__caml_parser_env, 0); + return { + TAG: "Minus", + _0: _1, + _1: _3 + }; + }), (function (__caml_parser_env) { - var _1 = Parsing.peek_val(__caml_parser_env, 2); - var _3 = Parsing.peek_val(__caml_parser_env, 0); - return { - TAG: "Times", - _0: _1, - _1: _3 - }; - }), + var _1 = Parsing.peek_val(__caml_parser_env, 2); + var _3 = Parsing.peek_val(__caml_parser_env, 0); + return { + TAG: "Times", + _0: _1, + _1: _3 + }; + }), (function (__caml_parser_env) { - var _1 = Parsing.peek_val(__caml_parser_env, 2); - var _3 = Parsing.peek_val(__caml_parser_env, 0); - return { - TAG: "Divide", - _0: _1, - _1: _3 - }; - }), + var _1 = Parsing.peek_val(__caml_parser_env, 2); + var _3 = Parsing.peek_val(__caml_parser_env, 0); + return { + TAG: "Divide", + _0: _1, + _1: _3 + }; + }), (function (__caml_parser_env) { - var _2 = Parsing.peek_val(__caml_parser_env, 0); - return { - TAG: "Negate", - _0: _2 - }; - }), + var _2 = Parsing.peek_val(__caml_parser_env, 0); + return { + TAG: "Negate", + _0: _2 + }; + }), (function (__caml_parser_env) { - return Parsing.peek_val(__caml_parser_env, 1); - }), + return Parsing.peek_val(__caml_parser_env, 1); + }), (function (__caml_parser_env) { - throw { - RE_EXN_ID: Parsing.YYexit, - _1: Parsing.peek_val(__caml_parser_env, 0), - Error: new Error() - }; - }) + throw { + RE_EXN_ID: Parsing.YYexit, + _1: Parsing.peek_val(__caml_parser_env, 0), + Error: new Error() + }; + }) ]; var yytables = { diff --git a/jscomp/test/arity_deopt.js b/jscomp/test/arity_deopt.js index c499bc2d4b..721b1b85ef 100644 --- a/jscomp/test/arity_deopt.js +++ b/jscomp/test/arity_deopt.js @@ -17,12 +17,12 @@ function eq(loc, x, y) { hd: [ loc + (" id " + String(test_id.contents)), (function (param) { - return { - TAG: "Eq", - _0: x, - _1: y - }; - }) + return { + TAG: "Eq", + _0: x, + _1: y + }; + }) ], tl: suites.contents }; @@ -53,14 +53,14 @@ function f3(x) { eq("File \"arity_deopt.res\", line 47, characters 11-18", 6, 6); eq("File \"arity_deopt.res\", line 48, characters 11-18", 6, (function (y, z) { - return (1 + y | 0) + z | 0; - })(2, 3)); + return (1 + y | 0) + z | 0; +})(2, 3)); eq("File \"arity_deopt.res\", line 49, characters 11-18", 6, 6); eq("File \"arity_deopt.res\", line 50, characters 11-18", 6, (function (y, z) { - return (1 + y | 0) + z | 0; - })(2, 3)); + return (1 + y | 0) + z | 0; +})(2, 3)); Mt.from_pair_suites("Arity_deopt", suites.contents); diff --git a/jscomp/test/arity_infer.js b/jscomp/test/arity_infer.js index 4f44315821..8472ac3262 100644 --- a/jscomp/test/arity_infer.js +++ b/jscomp/test/arity_infer.js @@ -7,8 +7,8 @@ function f0(x) { var tmp; if (x > 3) { tmp = (function (x) { - return x + 1 | 0; - }); + return x + 1 | 0; + }); } else { throw { RE_EXN_ID: "Not_found", @@ -31,23 +31,23 @@ function f3(x) { switch (x) { case 0 : tmp = (function (x) { - return x + 1 | 0; - }); + return x + 1 | 0; + }); break; case 1 : tmp = (function (x) { - return x + 2 | 0; - }); + return x + 2 | 0; + }); break; case 2 : tmp = (function (x) { - return x + 3 | 0; - }); + return x + 3 | 0; + }); break; case 3 : tmp = (function (x) { - return x + 4 | 0; - }); + return x + 4 | 0; + }); break; default: throw { diff --git a/jscomp/test/array_data_util.js b/jscomp/test/array_data_util.js index 32919a1860..4a966b4ef3 100644 --- a/jscomp/test/array_data_util.js +++ b/jscomp/test/array_data_util.js @@ -5,14 +5,14 @@ var Belt_Array = require("../../lib/js/belt_Array.js"); function range(i, j) { return Belt_Array.makeBy((j - i | 0) + 1 | 0, (function (k) { - return k + i | 0; - })); + return k + i | 0; + })); } function randomRange(i, j) { var v = Belt_Array.makeBy((j - i | 0) + 1 | 0, (function (k) { - return k + i | 0; - })); + return k + i | 0; + })); Belt_Array.shuffleInPlace(v); return v; } diff --git a/jscomp/test/array_subtle_test.js b/jscomp/test/array_subtle_test.js index a5bc2cbaa3..e736670a35 100644 --- a/jscomp/test/array_subtle_test.js +++ b/jscomp/test/array_subtle_test.js @@ -20,12 +20,12 @@ function eq(loc, param) { hd: [ loc + (" id " + String(test_id.contents)), (function (param) { - return { - TAG: "Eq", - _0: x, - _1: y - }; - }) + return { + TAG: "Eq", + _0: x, + _1: y + }; + }) ], tl: suites.contents }; @@ -39,45 +39,45 @@ var v = [ ]; eq("File \"array_subtle_test.res\", line 11, characters 12-19", [ - 4, - v.length - ]); + 4, + v.length +]); eq("File \"array_subtle_test.res\", line 14, characters 5-12", [ - 5, - v.push(3) - ]); + 5, + v.push(3) +]); eq("File \"array_subtle_test.res\", line 15, characters 5-12", [ - 5, - v.length - ]); + 5, + v.length +]); eq("File \"array_subtle_test.res\", line 16, characters 5-12", [ - 5, - v.length - ]); + 5, + v.length +]); eq("File \"array_subtle_test.res\", line 20, characters 5-12", [ - 3, - Caml_array.get(v, 2) - ]); + 3, + Caml_array.get(v, 2) +]); Caml_array.set(v, 2, 4); eq("File \"array_subtle_test.res\", line 22, characters 5-12", [ - 4, - Caml_array.get(v, 2) - ]); + 4, + Caml_array.get(v, 2) +]); while(v.length > 0) { v.pop(); }; eq("File \"array_subtle_test.res\", line 29, characters 5-12", [ - 0, - v.length - ]); + 0, + v.length +]); function f(v) { var x = v.pop(); @@ -114,19 +114,19 @@ function fff4(x) { } eq("File \"array_subtle_test.res\", line 61, characters 3-10", [ - fff3([]), - 1 - ]); + fff3([]), + 1 +]); eq("File \"array_subtle_test.res\", line 62, characters 3-10", [ - fff4([]), - 2 - ]); + fff4([]), + 2 +]); eq("File \"array_subtle_test.res\", line 63, characters 3-10", [ - fff4([1]), - 1 - ]); + fff4([1]), + 1 +]); Mt.from_pair_suites("Array_subtle_test", suites.contents); diff --git a/jscomp/test/array_test.js b/jscomp/test/array_test.js index 9fb0e84aaf..a1161cbe26 100644 --- a/jscomp/test/array_test.js +++ b/jscomp/test/array_test.js @@ -58,298 +58,298 @@ function is_sorted(x) { var array_suites_0 = [ "init", (function (param) { - return { - TAG: "Eq", - _0: $$Array.init(5, (function (x) { - return x; - })), - _1: [ - 0, - 1, - 2, - 3, - 4 - ] - }; - }) + return { + TAG: "Eq", + _0: $$Array.init(5, (function (x) { + return x; + })), + _1: [ + 0, + 1, + 2, + 3, + 4 + ] + }; + }) ]; var array_suites_1 = { hd: [ "toList", (function (param) { - var aux = function (xs) { - return List.fold_left((function (acc, param) { - return { - hd: [ - $$Array.to_list(param[0]), - param[1] - ], - tl: acc - }; - }), /* [] */0, xs); - }; - var match = List.split(aux({ - hd: [ - [], - /* [] */0 - ], - tl: /* [] */0 - })); - return { - TAG: "Eq", - _0: match[0], - _1: match[1] - }; - }) + var aux = function (xs) { + return List.fold_left((function (acc, param) { + return { + hd: [ + $$Array.to_list(param[0]), + param[1] + ], + tl: acc + }; + }), /* [] */0, xs); + }; + var match = List.split(aux({ + hd: [ + [], + /* [] */0 + ], + tl: /* [] */0 + })); + return { + TAG: "Eq", + _0: match[0], + _1: match[1] + }; + }) ], tl: { hd: [ "concat", (function (param) { - return { - TAG: "Eq", - _0: [ + return { + TAG: "Eq", + _0: [ + 0, + 1, + 2, + 3, + 4, + 5 + ], + _1: Caml_array.concat({ + hd: [ 0, 1, - 2, - 3, - 4, - 5 + 2 ], - _1: Caml_array.concat({ - hd: [ - 0, - 1, - 2 - ], - tl: { - hd: [ - 3, - 4 - ], - tl: { - hd: [], - tl: { - hd: [5], - tl: /* [] */0 - } - } - } - }) - }; - }) + tl: { + hd: [ + 3, + 4 + ], + tl: { + hd: [], + tl: { + hd: [5], + tl: /* [] */0 + } + } + } + }) + }; + }) ], tl: { hd: [ "make", (function (param) { + return { + TAG: "Eq", + _0: [ + Caml_array.make(100, /* 'a' */97), + Caml_array.make_float(100) + ], + _1: [ + $$Array.init(100, (function (param) { + return /* 'a' */97; + })), + $$Array.init(100, (function (param) { + return 0; + })) + ] + }; + }) + ], + tl: { + hd: [ + "sub", + (function (param) { return { TAG: "Eq", - _0: [ - Caml_array.make(100, /* 'a' */97), - Caml_array.make_float(100) - ], + _0: $$Array.sub([ + 0, + 1, + 2, + 3, + 4 + ], 2, 2), _1: [ - $$Array.init(100, (function (param) { - return /* 'a' */97; - })), - $$Array.init(100, (function (param) { - return 0; - })) + 2, + 3 ] }; }) - ], - tl: { - hd: [ - "sub", - (function (param) { - return { - TAG: "Eq", - _0: $$Array.sub([ - 0, - 1, - 2, - 3, - 4 - ], 2, 2), - _1: [ - 2, - 3 - ] - }; - }) ], tl: { hd: [ "blit", (function (param) { - var u = [ - 100, - 0, - 0 - ]; - var v = $$Array.init(3, (function (x) { - return (x << 1); - })); - $$Array.blit(v, 1, u, 1, 2); - return { - TAG: "Eq", - _0: [ - [ - 0, - 2, - 4 - ], - [ - 100, - 2, - 4 - ] + var u = [ + 100, + 0, + 0 + ]; + var v = $$Array.init(3, (function (x) { + return (x << 1); + })); + $$Array.blit(v, 1, u, 1, 2); + return { + TAG: "Eq", + _0: [ + [ + 0, + 2, + 4 ], - _1: [ - v, - u + [ + 100, + 2, + 4 ] - }; - }) + ], + _1: [ + v, + u + ] + }; + }) ], tl: { hd: [ "File \"array_test.res\", line 75, characters 8-15", (function (param) { + var a0 = $$Array.init(100, (function (i) { + return (i << 0); + })); + $$Array.blit(a0, 10, a0, 5, 20); + return { + TAG: "Eq", + _0: true, + _1: starts_with(a0, [ + 0, + 1, + 2, + 3, + 4, + 10, + 11, + 12, + 13, + 14, + 15, + 16, + 17, + 18, + 19, + 20, + 21, + 22, + 23, + 24, + 25, + 26, + 27, + 28 + ], (function (prim0, prim1) { + return prim0 === prim1; + })) + }; + }) + ], + tl: { + hd: [ + "File \"array_test.res\", line 118, characters 8-15", + (function (param) { var a0 = $$Array.init(100, (function (i) { - return (i << 0); - })); - $$Array.blit(a0, 10, a0, 5, 20); + return (i << 0); + })); + $$Array.blit(a0, 5, a0, 10, 20); return { TAG: "Eq", _0: true, _1: starts_with(a0, [ - 0, - 1, - 2, - 3, - 4, - 10, - 11, - 12, - 13, - 14, - 15, - 16, - 17, - 18, - 19, - 20, - 21, - 22, - 23, - 24, - 25, - 26, - 27, - 28 - ], (function (prim0, prim1) { - return prim0 === prim1; - })) + 0, + 1, + 2, + 3, + 4, + 5, + 6, + 7, + 8, + 9, + 5, + 6, + 7, + 8, + 9, + 10, + 11, + 12, + 13, + 14, + 15, + 16, + 17, + 18, + 19, + 20 + ], (function (prim0, prim1) { + return prim0 === prim1; + })) }; }) - ], - tl: { - hd: [ - "File \"array_test.res\", line 118, characters 8-15", - (function (param) { - var a0 = $$Array.init(100, (function (i) { - return (i << 0); - })); - $$Array.blit(a0, 5, a0, 10, 20); - return { - TAG: "Eq", - _0: true, - _1: starts_with(a0, [ - 0, - 1, - 2, - 3, - 4, - 5, - 6, - 7, - 8, - 9, - 5, - 6, - 7, - 8, - 9, - 10, - 11, - 12, - 13, - 14, - 15, - 16, - 17, - 18, - 19, - 20 - ], (function (prim0, prim1) { - return prim0 === prim1; - })) - }; - }) ], tl: { hd: [ "make", (function (param) { - return { - TAG: "Eq", - _0: Caml_array.make(2, 1), - _1: [ - 1, - 1 - ] - }; - }) + return { + TAG: "Eq", + _0: Caml_array.make(2, 1), + _1: [ + 1, + 1 + ] + }; + }) ], tl: { hd: [ "sort", (function (param) { - var u = [ - 3, + var u = [ + 3, + 0, + 1 + ]; + $$Array.sort(Caml.int_compare, u); + return { + TAG: "Eq", + _0: Caml_obj.equal([ 0, - 1 - ]; - $$Array.sort(Caml.int_compare, u); - return { - TAG: "Eq", - _0: Caml_obj.equal([ - 0, - 1, - 3 - ], u), - _1: true - }; - }) + 1, + 3 + ], u), + _1: true + }; + }) ], tl: { hd: [ "sort_large", (function (param) { - var v = $$Array.init(4, (function (i) { - return i % 17; - })); - $$Array.sort(Caml.int_compare, v); - return { - TAG: "Eq", - _0: true, - _1: is_sorted(v) - }; - }) + var v = $$Array.init(4, (function (i) { + return i % 17; + })); + $$Array.sort(Caml.int_compare, v); + return { + TAG: "Eq", + _0: true, + _1: is_sorted(v) + }; + }) ], tl: /* [] */0 } diff --git a/jscomp/test/ast_abstract_test.js b/jscomp/test/ast_abstract_test.js index 6238172472..967a7625c3 100644 --- a/jscomp/test/ast_abstract_test.js +++ b/jscomp/test/ast_abstract_test.js @@ -18,12 +18,12 @@ function eq(loc, x, y) { hd: [ loc + (" id " + String(test_id.contents)), (function (param) { - return { - TAG: "Eq", - _0: x, - _1: y - }; - }) + return { + TAG: "Eq", + _0: x, + _1: y + }; + }) ], tl: suites.contents }; diff --git a/jscomp/test/async_inline.js b/jscomp/test/async_inline.js index c0094bf55d..50c38d479f 100644 --- a/jscomp/test/async_inline.js +++ b/jscomp/test/async_inline.js @@ -12,16 +12,16 @@ var inlined = willBeInlined(); function wrapSomethingAsync(param) { ((async function (param) { - var test = await Promise.resolve("Test"); - console.log(test); - })(777)); + var test = await Promise.resolve("Test"); + console.log(test); + })(777)); } function wrapSomethingAsync2(param) { ((async function (param) { - var test = await Promise.resolve("Test"); - console.log(test); - })()); + var test = await Promise.resolve("Test"); + console.log(test); + })()); } async function doSomethingAsync(someAsyncFunction) { @@ -76,8 +76,8 @@ async function nested2(param) { function onSubmit(param) { return React.useCallback(async function (_a, b) { - return await b; - }); + return await b; + }); } var tci = 3; diff --git a/jscomp/test/attr_test.js b/jscomp/test/attr_test.js index 72d0bdde2c..c1b21aff87 100644 --- a/jscomp/test/attr_test.js +++ b/jscomp/test/attr_test.js @@ -16,8 +16,8 @@ var hh = 1 + 2; function f(x) { des(x, (function (param) { - console.log("hei"); - })); + console.log("hei"); + })); } exports.u = u; diff --git a/jscomp/test/bdd.js b/jscomp/test/bdd.js index 48bae95cfa..5a62c994f1 100644 --- a/jscomp/test/bdd.js +++ b/jscomp/test/bdd.js @@ -89,9 +89,9 @@ function resize(newSize) { } else { var ind = hashVal(getId(n._0), getId(n._3), n._1) & newSz_1; Caml_array.set(newArr, ind, { - hd: n, - tl: Caml_array.get(newArr, ind) - }); + hd: n, + tl: Caml_array.get(newArr, ind) + }); _bucket = bucket.tl; continue ; } @@ -107,18 +107,18 @@ function resize(newSize) { function insert(idl, idh, v, ind, bucket, newNode) { if (n_items.contents <= sz_1.contents) { Caml_array.set(htab.contents, ind, { - hd: newNode, - tl: bucket - }); + hd: newNode, + tl: bucket + }); n_items.contents = n_items.contents + 1 | 0; return; } resize((sz_1.contents + sz_1.contents | 0) + 2 | 0); var ind$1 = hashVal(idl, idh, v) & sz_1.contents; Caml_array.set(htab.contents, ind$1, { - hd: newNode, - tl: Caml_array.get(htab.contents, ind$1) - }); + hd: newNode, + tl: Caml_array.get(htab.contents, ind$1) + }); } function resetUnique(param) { diff --git a/jscomp/test/belt_result_alias_test.js b/jscomp/test/belt_result_alias_test.js index b66a69291e..0a50a1287d 100644 --- a/jscomp/test/belt_result_alias_test.js +++ b/jscomp/test/belt_result_alias_test.js @@ -4,17 +4,17 @@ var Belt_Result = require("../../lib/js/belt_Result.js"); Belt_Result.map({ - TAG: "Ok", - _0: "Test" - }, (function (r) { - return "Value: " + r; - })); + TAG: "Ok", + _0: "Test" +}, (function (r) { + return "Value: " + r; +})); Belt_Result.getWithDefault(Belt_Result.map({ - TAG: "Error", - _0: "error" - }, (function (r) { - return "Value: " + r; - })), "success"); + TAG: "Error", + _0: "error" +}, (function (r) { + return "Value: " + r; +})), "success"); /* Not a pure module */ diff --git a/jscomp/test/bench.js b/jscomp/test/bench.js index d7206950d9..c7d2ae306f 100644 --- a/jscomp/test/bench.js +++ b/jscomp/test/bench.js @@ -48,14 +48,14 @@ function fold_left(f, x, a) { function f2(param) { var arr = init(3000000, (function (i) { - return i; - })); + return i; + })); var b = map((function (i) { - return i + i - 1; - }), arr); + return i + i - 1; + }), arr); var v = fold_left((function (prim0, prim1) { - return prim0 + prim1; - }), 0, b); + return prim0 + prim1; + }), 0, b); console.log(Pervasives.string_of_float(v)); } diff --git a/jscomp/test/bigint_test.js b/jscomp/test/bigint_test.js index 7cc08970f0..b6dac732aa 100644 --- a/jscomp/test/bigint_test.js +++ b/jscomp/test/bigint_test.js @@ -123,34 +123,34 @@ Mt_global.collect_eq(test_id, suites, "File \"bigint_test.res\", line 42, charac Mt_global.collect_eq(test_id, suites, "File \"bigint_test.res\", line 43, characters 5-12", Caml_obj.equal(1000000000000000000000000000000000000000000000000000000000000000000000000000000000000n, -1000000000000000000000000000000000000000000000000000000000000000000000000000000000000n), false); Mt_global.collect_eq(test_id, suites, "File \"bigint_test.res\", line 44, characters 5-12", ( - 1n !== 1n ? ( - 1n !== 2n ? 0n : 4n - ) : 3n - ) === 3n, true); + 1n !== 1n ? ( + 1n !== 2n ? 0n : 4n + ) : 3n +) === 3n, true); Mt_global.collect_eq(test_id, suites, "File \"bigint_test.res\", line 49, characters 5-12", Caml_obj.equal(1n !== 1n ? ( - 1n !== 2n ? 0n : 4n - ) : 3n, 3n), true); + 1n !== 2n ? 0n : 4n + ) : 3n, 3n), true); Mt_global.collect_eq(test_id, suites, "File \"bigint_test.res\", line 54, characters 5-12", ( - -1n !== -2n ? ( - -1n !== -1n ? 0n : 3n - ) : 4n - ) === 3n, true); + -1n !== -2n ? ( + -1n !== -1n ? 0n : 3n + ) : 4n +) === 3n, true); Mt_global.collect_eq(test_id, suites, "File \"bigint_test.res\", line 59, characters 5-12", Caml_obj.equal(-1n !== -1n ? ( - -1n !== 2n ? 0n : 4n - ) : 3n, 3n), true); + -1n !== 2n ? 0n : 4n + ) : 3n, 3n), true); Mt_global.collect_eq(test_id, suites, "File \"bigint_test.res\", line 64, characters 5-12", ( - -1000n !== -1000n ? ( - -1000n !== -2n ? 0n : 4n - ) : 3n - ) === 3n, true); + -1000n !== -1000n ? ( + -1000n !== -2n ? 0n : 4n + ) : 3n +) === 3n, true); Mt_global.collect_eq(test_id, suites, "File \"bigint_test.res\", line 69, characters 5-12", Caml_obj.equal(-1000n !== -1000n ? ( - -1000n !== -2n ? 0n : 4n - ) : 3n, 3n), true); + -1000n !== -2n ? 0n : 4n + ) : 3n, 3n), true); Mt_global.collect_eq(test_id, suites, "File \"bigint_test.res\", line 74, characters 5-12", 9n & 1n, 1n); diff --git a/jscomp/test/block_alias_test.js b/jscomp/test/block_alias_test.js index f74dce09ac..20b7e2d643 100644 --- a/jscomp/test/block_alias_test.js +++ b/jscomp/test/block_alias_test.js @@ -53,18 +53,18 @@ var V = { var f = Caml_obj.equal; eq("File \"block_alias_test.res\", line 27, characters 3-10", List.length({ - hd: 1, - tl: { - hd: 2, - tl: /* [] */0 - } - }), 2); + hd: 1, + tl: { + hd: 2, + tl: /* [] */0 + } +}), 2); b("File \"block_alias_test.res\", line 28, characters 2-9", Caml_obj.equal(v0, { - TAG: "A", - _0: 0, - _1: 1 - })); + TAG: "A", + _0: 0, + _1: 1 +})); eq("File \"block_alias_test.res\", line 29, characters 3-10", v0, v1); diff --git a/jscomp/test/boolean_test.js b/jscomp/test/boolean_test.js index 2f60072ef0..d64ec5ae96 100644 --- a/jscomp/test/boolean_test.js +++ b/jscomp/test/boolean_test.js @@ -5,11 +5,11 @@ var Mt = require("./mt.js"); var Test_bool_equal = require("./test_bool_equal.js"); Mt.from_suites("boolean", { - hd: [ - "bool_equal", - Test_bool_equal.assertions - ], - tl: /* [] */0 - }); + hd: [ + "bool_equal", + Test_bool_equal.assertions + ], + tl: /* [] */0 +}); /* Not a pure module */ diff --git a/jscomp/test/bs_abstract_test.js b/jscomp/test/bs_abstract_test.js index 2590040e73..c05cf5631a 100644 --- a/jscomp/test/bs_abstract_test.js +++ b/jscomp/test/bs_abstract_test.js @@ -12,8 +12,8 @@ v.tl = v; var f = { k: (function (x, y) { - return x === y; - }), + return x === y; + }), y: "x" }; diff --git a/jscomp/test/bs_array_test.js b/jscomp/test/bs_array_test.js index edc4ee7425..f5e587d105 100644 --- a/jscomp/test/bs_array_test.js +++ b/jscomp/test/bs_array_test.js @@ -37,12 +37,12 @@ function neq(loc, x, y) { hd: [ loc + (" id " + String(test_id.contents)), (function (param) { - return { - TAG: "Neq", - _0: x, - _1: y - }; - }) + return { + TAG: "Neq", + _0: x, + _1: y + }; + }) ], tl: suites.contents }; @@ -53,17 +53,17 @@ function push(prim0, prim1) { } console.log([ - 1, - 2, - 3, - 4 - ].filter(function (x) { - return x > 2; - }).map(function (x, i) { - return x + i | 0; - }).reduce((function (x, y) { - return x + y | 0; - }), 0)); + 1, + 2, + 3, + 4 +].filter(function (x) { + return x > 2; +}).map(function (x, i) { + return x + i | 0; +}).reduce((function (x, y) { + return x + y | 0; +}), 0)); var v = [ 1, @@ -71,32 +71,32 @@ var v = [ ]; eq("File \"bs_array_test.res\", line 31, characters 4-11", [ - Belt_Array.get(v, 0), - Belt_Array.get(v, 1), - Belt_Array.get(v, 2), - Belt_Array.get(v, 3), - Belt_Array.get(v, -1) - ], [ - 1, - 2, - undefined, - undefined, - undefined - ]); + Belt_Array.get(v, 0), + Belt_Array.get(v, 1), + Belt_Array.get(v, 2), + Belt_Array.get(v, 3), + Belt_Array.get(v, -1) +], [ + 1, + 2, + undefined, + undefined, + undefined +]); $$throw("File \"bs_array_test.res\", line 35, characters 8-15", (function (param) { - Belt_Array.getExn([ - 0, - 1 - ], -1); - })); + Belt_Array.getExn([ + 0, + 1 + ], -1); +})); $$throw("File \"bs_array_test.res\", line 36, characters 8-15", (function (param) { - Belt_Array.getExn([ - 0, - 1 - ], 2); - })); + Belt_Array.getExn([ + 0, + 1 + ], 2); +})); var partial_arg = [ 0, @@ -108,31 +108,31 @@ function f(param) { } b("File \"bs_array_test.res\", line 38, characters 4-11", Caml_obj.equal([ - Curry._1(f, 0), - Curry._1(f, 1) - ], [ - 0, - 1 - ])); + Curry._1(f, 0), + Curry._1(f, 1) +], [ + 0, + 1 +])); $$throw("File \"bs_array_test.res\", line 44, characters 8-15", (function (param) { - Belt_Array.setExn([ - 0, - 1 - ], -1, 0); - })); + Belt_Array.setExn([ + 0, + 1 + ], -1, 0); +})); $$throw("File \"bs_array_test.res\", line 45, characters 8-15", (function (param) { - Belt_Array.setExn([ - 0, - 1 - ], 2, 0); - })); + Belt_Array.setExn([ + 0, + 1 + ], 2, 0); +})); b("File \"bs_array_test.res\", line 46, characters 4-11", !Belt_Array.set([ - 1, - 2 - ], 2, 0)); + 1, + 2 +], 2, 0)); var v$1 = [ 1, @@ -191,118 +191,118 @@ function id(x) { } eq("File \"bs_array_test.res\", line 84, characters 5-12", Js_list.toVector({ - hd: 1, - tl: { - hd: 2, - tl: { - hd: 3, - tl: /* [] */0 - } - } - }), [ - 1, - 2, - 3 - ]); + hd: 1, + tl: { + hd: 2, + tl: { + hd: 3, + tl: /* [] */0 + } + } +}), [ + 1, + 2, + 3 +]); eq("File \"bs_array_test.res\", line 85, characters 5-12", Js_vector.map((function (x) { - return x + 1 | 0; - }), [ - 1, - 2, - 3 - ]), [ - 2, - 3, - 4 - ]); + return x + 1 | 0; +}), [ + 1, + 2, + 3 +]), [ + 2, + 3, + 4 +]); eq("File \"bs_array_test.res\", line 86, characters 5-12", Caml_array.make(5, 3), [ - 3, - 3, - 3, - 3, - 3 - ]); + 3, + 3, + 3, + 3, + 3 +]); var a = Js_vector.init(5, (function (i) { - return i + 1 | 0; - })); + return i + 1 | 0; +})); eq("File \"bs_array_test.res\", line 88, characters 4-11", (Js_vector.filterInPlace((function (j) { - return j % 2 === 0; - }), a), a), [ - 2, - 4 - ]); + return j % 2 === 0; +}), a), a), [ + 2, + 4 +]); var a$1 = Js_vector.init(5, (function (i) { - return i + 1 | 0; - })); + return i + 1 | 0; +})); eq("File \"bs_array_test.res\", line 98, characters 4-11", (Js_vector.filterInPlace((function (j) { - return j % 2 !== 0; - }), a$1), a$1), [ - 1, - 3, - 5 - ]); + return j % 2 !== 0; +}), a$1), a$1), [ + 1, + 3, + 5 +]); eq("File \"bs_array_test.res\", line 107, characters 5-12", Js_list.toVector({ - hd: 1, - tl: { - hd: 2, - tl: { - hd: 3, - tl: /* [] */0 - } - } - }), [ - 1, - 2, - 3 - ]); + hd: 1, + tl: { + hd: 2, + tl: { + hd: 3, + tl: /* [] */0 + } + } +}), [ + 1, + 2, + 3 +]); eq("File \"bs_array_test.res\", line 108, characters 5-12", Js_list.toVector({ - hd: 1, - tl: /* [] */0 - }), [1]); + hd: 1, + tl: /* [] */0 +}), [1]); id(/* [] */0); id({ - hd: 1, - tl: /* [] */0 - }); + hd: 1, + tl: /* [] */0 +}); id({ - hd: 1, + hd: 1, + tl: { + hd: 2, + tl: { + hd: 3, tl: { - hd: 2, + hd: 4, tl: { - hd: 3, - tl: { - hd: 4, - tl: { - hd: 5, - tl: /* [] */0 - } - } + hd: 5, + tl: /* [] */0 } } - }); + } + } +}); id(Js_vector.toList(Js_vector.init(100, (function (i) { - return i; - })))); + return i; +})))); function add(x, y) { return x + y | 0; } var v$5 = Belt_Array.makeBy(3000, (function (i) { - return i; - })); + return i; +})); var u = Belt_Array.shuffle(v$5); @@ -311,30 +311,30 @@ neq("File \"bs_array_test.res\", line 122, characters 6-13", u, v$5); eq("File \"bs_array_test.res\", line 124, characters 5-12", Belt_Array.reduce(u, 0, add), Belt_Array.reduce(v$5, 0, add)); b("File \"bs_array_test.res\", line 129, characters 4-11", Caml_obj.equal(Belt_Array.range(0, 3), [ - 0, - 1, - 2, - 3 - ])); + 0, + 1, + 2, + 3 +])); b("File \"bs_array_test.res\", line 130, characters 4-11", Caml_obj.equal(Belt_Array.range(3, 0), [])); b("File \"bs_array_test.res\", line 131, characters 4-11", Caml_obj.equal(Belt_Array.range(3, 3), [3])); b("File \"bs_array_test.res\", line 133, characters 4-11", Caml_obj.equal(Belt_Array.rangeBy(0, 10, 3), [ - 0, - 3, - 6, - 9 - ])); + 0, + 3, + 6, + 9 +])); b("File \"bs_array_test.res\", line 134, characters 4-11", Caml_obj.equal(Belt_Array.rangeBy(0, 12, 3), [ - 0, - 3, - 6, - 9, - 12 - ])); + 0, + 3, + 6, + 9, + 12 +])); b("File \"bs_array_test.res\", line 135, characters 4-11", Caml_obj.equal(Belt_Array.rangeBy(33, 0, 1), [])); @@ -347,44 +347,44 @@ b("File \"bs_array_test.res\", line 138, characters 4-11", Caml_obj.equal(Belt_A b("File \"bs_array_test.res\", line 139, characters 4-11", Caml_obj.equal(Belt_Array.rangeBy(3, 3, 1), [3])); eq("File \"bs_array_test.res\", line 143, characters 5-12", Belt_Array.reduceReverse([], 100, (function (prim0, prim1) { - return prim0 - prim1 | 0; - })), 100); + return prim0 - prim1 | 0; +})), 100); eq("File \"bs_array_test.res\", line 144, characters 5-12", Belt_Array.reduceReverse([ - 1, - 2 - ], 100, (function (prim0, prim1) { - return prim0 - prim1 | 0; - })), 97); + 1, + 2 +], 100, (function (prim0, prim1) { + return prim0 - prim1 | 0; +})), 97); eq("File \"bs_array_test.res\", line 145, characters 5-12", Belt_Array.reduceReverse([ - 1, - 2, - 3, - 4 - ], 100, (function (prim0, prim1) { - return prim0 - prim1 | 0; - })), 90); + 1, + 2, + 3, + 4 +], 100, (function (prim0, prim1) { + return prim0 - prim1 | 0; +})), 90); eq("File \"bs_array_test.res\", line 146, characters 5-12", Belt_Array.reduceWithIndex([ - 1, - 2, - 3, - 4 - ], 0, (function (acc, x, i) { - return (acc + x | 0) + i | 0; - })), 16); + 1, + 2, + 3, + 4 +], 0, (function (acc, x, i) { + return (acc + x | 0) + i | 0; +})), 16); b("File \"bs_array_test.res\", line 147, characters 4-11", Belt_Array.reduceReverse2([ - 1, - 2, - 3 - ], [ - 1, - 2 - ], 0, (function (acc, x, y) { - return (acc + x | 0) + y | 0; - })) === 6); + 1, + 2, + 3 +], [ + 1, + 2 +], 0, (function (acc, x, y) { + return (acc + x | 0) + y | 0; +})) === 6); function addone(x) { return x + 1 | 0; @@ -414,43 +414,43 @@ function makeMatrixExn(sx, sy, init) { } eq("File \"bs_array_test.res\", line 166, characters 5-12", Belt_Array.makeBy(0, (function (param) { - return 1; - })), []); + return 1; +})), []); eq("File \"bs_array_test.res\", line 167, characters 5-12", Belt_Array.makeBy(3, (function (i) { - return i; - })), [ - 0, - 1, - 2 - ]); + return i; +})), [ + 0, + 1, + 2 +]); eq("File \"bs_array_test.res\", line 168, characters 5-12", makeMatrixExn(3, 4, 1), [ - [ - 1, - 1, - 1, - 1 - ], - [ - 1, - 1, - 1, - 1 - ], - [ - 1, - 1, - 1, - 1 - ] - ]); + [ + 1, + 1, + 1, + 1 + ], + [ + 1, + 1, + 1, + 1 + ], + [ + 1, + 1, + 1, + 1 + ] +]); eq("File \"bs_array_test.res\", line 169, characters 5-12", makeMatrixExn(3, 0, 0), [ - [], - [], - [] - ]); + [], + [], + [] +]); eq("File \"bs_array_test.res\", line 170, characters 5-12", makeMatrixExn(0, 3, 1), []); @@ -459,129 +459,129 @@ eq("File \"bs_array_test.res\", line 171, characters 5-12", makeMatrixExn(1, 1, eq("File \"bs_array_test.res\", line 172, characters 5-12", [].slice(0), []); eq("File \"bs_array_test.res\", line 173, characters 5-12", Belt_Array.map([], (function (prim) { - return prim + 1 | 0; - })), []); + return prim + 1 | 0; +})), []); eq("File \"bs_array_test.res\", line 174, characters 5-12", Belt_Array.mapWithIndex([], add), []); eq("File \"bs_array_test.res\", line 175, characters 5-12", Belt_Array.mapWithIndex([ - 1, - 2, - 3 - ], add), [ - 1, - 3, - 5 - ]); + 1, + 2, + 3 +], add), [ + 1, + 3, + 5 +]); eq("File \"bs_array_test.res\", line 176, characters 5-12", Belt_List.fromArray([]), /* [] */0); eq("File \"bs_array_test.res\", line 177, characters 5-12", Belt_List.fromArray([1]), { - hd: 1, - tl: /* [] */0 - }); + hd: 1, + tl: /* [] */0 +}); eq("File \"bs_array_test.res\", line 178, characters 5-12", Belt_List.fromArray([ - 1, - 2, - 3 - ]), { - hd: 1, - tl: { - hd: 2, - tl: { - hd: 3, - tl: /* [] */0 - } - } - }); + 1, + 2, + 3 +]), { + hd: 1, + tl: { + hd: 2, + tl: { + hd: 3, + tl: /* [] */0 + } + } +}); eq("File \"bs_array_test.res\", line 179, characters 5-12", Belt_Array.map([ - 1, - 2, - 3 - ], (function (prim) { - return prim + 1 | 0; - })), [ - 2, - 3, - 4 - ]); + 1, + 2, + 3 +], (function (prim) { + return prim + 1 | 0; +})), [ + 2, + 3, + 4 +]); eq("File \"bs_array_test.res\", line 180, characters 5-12", Belt_List.toArray(/* [] */0), []); eq("File \"bs_array_test.res\", line 181, characters 5-12", Belt_List.toArray({ - hd: 1, - tl: /* [] */0 - }), [1]); + hd: 1, + tl: /* [] */0 +}), [1]); eq("File \"bs_array_test.res\", line 182, characters 5-12", Belt_List.toArray({ - hd: 1, - tl: { - hd: 2, - tl: /* [] */0 - } - }), [ - 1, - 2 - ]); + hd: 1, + tl: { + hd: 2, + tl: /* [] */0 + } +}), [ + 1, + 2 +]); eq("File \"bs_array_test.res\", line 183, characters 5-12", Belt_List.toArray({ - hd: 1, - tl: { - hd: 2, - tl: { - hd: 3, - tl: /* [] */0 - } - } - }), [ - 1, - 2, - 3 - ]); + hd: 1, + tl: { + hd: 2, + tl: { + hd: 3, + tl: /* [] */0 + } + } +}), [ + 1, + 2, + 3 +]); var v$6 = Belt_Array.makeBy(10, (function (i) { - return i; - })); + return i; +})); var v0 = Belt_Array.keep(v$6, (function (x) { - return x % 2 === 0; - })); + return x % 2 === 0; +})); var v1 = Belt_Array.keep(v$6, (function (x) { - return x % 3 === 0; - })); + return x % 3 === 0; +})); var v2 = Belt_Array.keepMap(v$6, (function (x) { - if (x % 2 === 0) { - return x + 1 | 0; - } - - })); + if (x % 2 === 0) { + return x + 1 | 0; + } + +})); eq("File \"bs_array_test.res\", line 197, characters 5-12", v0, [ - 0, - 2, - 4, - 6, - 8 - ]); + 0, + 2, + 4, + 6, + 8 +]); eq("File \"bs_array_test.res\", line 198, characters 5-12", v1, [ - 0, - 3, - 6, - 9 - ]); + 0, + 3, + 6, + 9 +]); eq("File \"bs_array_test.res\", line 199, characters 5-12", v2, [ - 1, - 3, - 5, - 7, - 9 - ]); + 1, + 3, + 5, + 7, + 9 +]); var a$2 = [ 1, @@ -592,36 +592,36 @@ var a$2 = [ ]; var match = Belt_Array.partition(a$2, (function (x) { - return x % 2 === 0; - })); + return x % 2 === 0; +})); eq("File \"bs_array_test.res\", line 205, characters 5-12", match[0], [ - 2, - 4 - ]); + 2, + 4 +]); eq("File \"bs_array_test.res\", line 206, characters 5-12", match[1], [ - 1, - 3, - 5 - ]); + 1, + 3, + 5 +]); var match$1 = Belt_Array.partition(a$2, (function (x) { - return x === 2; - })); + return x === 2; +})); eq("File \"bs_array_test.res\", line 208, characters 5-12", match$1[0], [2]); eq("File \"bs_array_test.res\", line 209, characters 5-12", match$1[1], [ - 1, - 3, - 4, - 5 - ]); + 1, + 3, + 4, + 5 +]); var match$2 = Belt_Array.partition([], (function (x) { - return false; - })); + return false; +})); eq("File \"bs_array_test.res\", line 211, characters 5-12", match$2[0], []); @@ -636,25 +636,25 @@ var a$3 = [ ]; eq("File \"bs_array_test.res\", line 217, characters 5-12", Belt_Array.slice(a$3, 0, 2), [ - 1, - 2 - ]); + 1, + 2 +]); eq("File \"bs_array_test.res\", line 218, characters 5-12", Belt_Array.slice(a$3, 0, 5), [ - 1, - 2, - 3, - 4, - 5 - ]); + 1, + 2, + 3, + 4, + 5 +]); eq("File \"bs_array_test.res\", line 219, characters 5-12", Belt_Array.slice(a$3, 0, 15), [ - 1, - 2, - 3, - 4, - 5 - ]); + 1, + 2, + 3, + 4, + 5 +]); eq("File \"bs_array_test.res\", line 220, characters 5-12", Belt_Array.slice(a$3, 5, 1), []); @@ -667,43 +667,43 @@ eq("File \"bs_array_test.res\", line 223, characters 5-12", Belt_Array.slice(a$3 eq("File \"bs_array_test.res\", line 224, characters 5-12", Belt_Array.slice(a$3, -2, 1), [4]); eq("File \"bs_array_test.res\", line 225, characters 5-12", Belt_Array.slice(a$3, -2, 2), [ - 4, - 5 - ]); + 4, + 5 +]); eq("File \"bs_array_test.res\", line 226, characters 5-12", Belt_Array.slice(a$3, -2, 3), [ - 4, - 5 - ]); + 4, + 5 +]); eq("File \"bs_array_test.res\", line 227, characters 5-12", Belt_Array.slice(a$3, -10, 3), [ - 1, - 2, - 3 - ]); + 1, + 2, + 3 +]); eq("File \"bs_array_test.res\", line 228, characters 5-12", Belt_Array.slice(a$3, -10, 4), [ - 1, - 2, - 3, - 4 - ]); + 1, + 2, + 3, + 4 +]); eq("File \"bs_array_test.res\", line 229, characters 5-12", Belt_Array.slice(a$3, -10, 5), [ - 1, - 2, - 3, - 4, - 5 - ]); + 1, + 2, + 3, + 4, + 5 +]); eq("File \"bs_array_test.res\", line 230, characters 5-12", Belt_Array.slice(a$3, -10, 6), [ - 1, - 2, - 3, - 4, - 5 - ]); + 1, + 2, + 3, + 4, + 5 +]); eq("File \"bs_array_test.res\", line 231, characters 5-12", Belt_Array.slice(a$3, 0, 0), []); @@ -718,12 +718,12 @@ var a$4 = [ ]; eq("File \"bs_array_test.res\", line 237, characters 5-12", Belt_Array.sliceToEnd(a$4, 0), [ - 1, - 2, - 3, - 4, - 5 - ]); + 1, + 2, + 3, + 4, + 5 +]); eq("File \"bs_array_test.res\", line 238, characters 5-12", Belt_Array.sliceToEnd(a$4, 5), []); @@ -732,158 +732,158 @@ eq("File \"bs_array_test.res\", line 239, characters 5-12", Belt_Array.sliceToEn eq("File \"bs_array_test.res\", line 240, characters 5-12", Belt_Array.sliceToEnd(a$4, -1), [5]); eq("File \"bs_array_test.res\", line 241, characters 5-12", Belt_Array.sliceToEnd(a$4, -2), [ - 4, - 5 - ]); + 4, + 5 +]); eq("File \"bs_array_test.res\", line 242, characters 5-12", Belt_Array.sliceToEnd(a$4, -10), [ - 1, - 2, - 3, - 4, - 5 - ]); + 1, + 2, + 3, + 4, + 5 +]); eq("File \"bs_array_test.res\", line 243, characters 5-12", Belt_Array.sliceToEnd(a$4, 6), []); var a$5 = Belt_Array.makeBy(10, (function (x) { - return x; - })); + return x; +})); Belt_Array.fill(a$5, 0, 3, 0); eq("File \"bs_array_test.res\", line 248, characters 5-12", a$5.slice(0), [ - 0, - 0, - 0, - 3, - 4, - 5, - 6, - 7, - 8, - 9 - ]); + 0, + 0, + 0, + 3, + 4, + 5, + 6, + 7, + 8, + 9 +]); Belt_Array.fill(a$5, 2, 8, 1); eq("File \"bs_array_test.res\", line 250, characters 5-12", a$5.slice(0), [ - 0, - 0, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1 - ]); + 0, + 0, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1 +]); Belt_Array.fill(a$5, 8, 1, 9); eq("File \"bs_array_test.res\", line 252, characters 5-12", a$5.slice(0), [ - 0, - 0, - 1, - 1, - 1, - 1, - 1, - 1, - 9, - 1 - ]); + 0, + 0, + 1, + 1, + 1, + 1, + 1, + 1, + 9, + 1 +]); Belt_Array.fill(a$5, 8, 2, 9); eq("File \"bs_array_test.res\", line 254, characters 5-12", a$5.slice(0), [ - 0, - 0, - 1, - 1, - 1, - 1, - 1, - 1, - 9, - 9 - ]); + 0, + 0, + 1, + 1, + 1, + 1, + 1, + 1, + 9, + 9 +]); Belt_Array.fill(a$5, 8, 3, 12); eq("File \"bs_array_test.res\", line 256, characters 5-12", a$5.slice(0), [ - 0, - 0, - 1, - 1, - 1, - 1, - 1, - 1, - 12, - 12 - ]); + 0, + 0, + 1, + 1, + 1, + 1, + 1, + 1, + 12, + 12 +]); Belt_Array.fill(a$5, -2, 3, 11); eq("File \"bs_array_test.res\", line 258, characters 5-12", a$5.slice(0), [ - 0, - 0, - 1, - 1, - 1, - 1, - 1, - 1, - 11, - 11 - ]); + 0, + 0, + 1, + 1, + 1, + 1, + 1, + 1, + 11, + 11 +]); Belt_Array.fill(a$5, -3, 3, 10); eq("File \"bs_array_test.res\", line 260, characters 5-12", a$5.slice(0), [ - 0, - 0, - 1, - 1, - 1, - 1, - 1, - 10, - 10, - 10 - ]); + 0, + 0, + 1, + 1, + 1, + 1, + 1, + 10, + 10, + 10 +]); Belt_Array.fill(a$5, -3, 1, 7); eq("File \"bs_array_test.res\", line 262, characters 5-12", a$5.slice(0), [ - 0, - 0, - 1, - 1, - 1, - 1, - 1, - 7, - 10, - 10 - ]); + 0, + 0, + 1, + 1, + 1, + 1, + 1, + 7, + 10, + 10 +]); Belt_Array.fill(a$5, -13, 1, 7); eq("File \"bs_array_test.res\", line 264, characters 5-12", a$5.slice(0), [ - 7, - 0, - 1, - 1, - 1, - 1, - 1, - 7, - 10, - 10 - ]); + 7, + 0, + 1, + 1, + 1, + 1, + 1, + 7, + 10, + 10 +]); Belt_Array.fill(a$5, -13, 12, 7); @@ -902,84 +902,84 @@ var b$1 = [ Belt_Array.fill(b$1, 0, 0, 0); eq("File \"bs_array_test.res\", line 271, characters 5-12", b$1, [ - 1, - 2, - 3 - ]); + 1, + 2, + 3 +]); Belt_Array.fill(b$1, 4, 1, 0); eq("File \"bs_array_test.res\", line 273, characters 5-12", b$1, [ - 1, - 2, - 3 - ]); + 1, + 2, + 3 +]); var a0 = Belt_Array.makeBy(10, (function (x) { - return x; - })); + return x; +})); var b0 = Belt_Array.make(10, 3); Belt_Array.blit(a0, 1, b0, 2, 5); eq("File \"bs_array_test.res\", line 280, characters 5-12", b0.slice(0), [ - 3, - 3, - 1, - 2, - 3, - 4, - 5, - 3, - 3, - 3 - ]); + 3, + 3, + 1, + 2, + 3, + 4, + 5, + 3, + 3, + 3 +]); Belt_Array.blit(a0, -1, b0, 2, 5); eq("File \"bs_array_test.res\", line 282, characters 5-12", b0.slice(0), [ - 3, - 3, - 9, - 2, - 3, - 4, - 5, - 3, - 3, - 3 - ]); + 3, + 3, + 9, + 2, + 3, + 4, + 5, + 3, + 3, + 3 +]); Belt_Array.blit(a0, -1, b0, -2, 5); eq("File \"bs_array_test.res\", line 284, characters 5-12", b0.slice(0), [ - 3, - 3, - 9, - 2, - 3, - 4, - 5, - 3, - 9, - 3 - ]); + 3, + 3, + 9, + 2, + 3, + 4, + 5, + 3, + 9, + 3 +]); Belt_Array.blit(a0, -2, b0, -2, 2); eq("File \"bs_array_test.res\", line 286, characters 5-12", b0.slice(0), [ - 3, - 3, - 9, - 2, - 3, - 4, - 5, - 3, - 8, - 9 - ]); + 3, + 3, + 9, + 2, + 3, + 4, + 5, + 3, + 8, + 9 +]); Belt_Array.blit(a0, -11, b0, -11, 100); @@ -990,68 +990,68 @@ Belt_Array.blit(a0, -11, b0, -11, 2); eq("File \"bs_array_test.res\", line 290, characters 5-12", b0.slice(0), a0); var aa = Belt_Array.makeBy(10, (function (x) { - return x; - })); + return x; +})); Belt_Array.blit(aa, -1, aa, 1, 2); eq("File \"bs_array_test.res\", line 293, characters 5-12", aa.slice(0), [ - 0, - 9, - 2, - 3, - 4, - 5, - 6, - 7, - 8, - 9 - ]); + 0, + 9, + 2, + 3, + 4, + 5, + 6, + 7, + 8, + 9 +]); Belt_Array.blit(aa, -2, aa, 1, 2); eq("File \"bs_array_test.res\", line 295, characters 5-12", aa.slice(0), [ - 0, - 8, - 9, - 3, - 4, - 5, - 6, - 7, - 8, - 9 - ]); + 0, + 8, + 9, + 3, + 4, + 5, + 6, + 7, + 8, + 9 +]); Belt_Array.blit(aa, -5, aa, 4, 3); eq("File \"bs_array_test.res\", line 297, characters 5-12", aa.slice(0), [ - 0, - 8, - 9, - 3, - 5, - 6, - 7, - 7, - 8, - 9 - ]); + 0, + 8, + 9, + 3, + 5, + 6, + 7, + 7, + 8, + 9 +]); Belt_Array.blit(aa, 4, aa, 5, 3); eq("File \"bs_array_test.res\", line 299, characters 5-12", aa.slice(0), [ - 0, - 8, - 9, - 3, - 5, - 5, - 6, - 7, - 8, - 9 - ]); + 0, + 8, + 9, + 3, + 5, + 5, + 6, + 7, + 8, + 9 +]); eq("File \"bs_array_test.res\", line 300, characters 5-12", Belt_Array.make(0, 3), []); @@ -1066,184 +1066,184 @@ var c = [ Belt_Array.blit(c, 4, c, 1, 1); eq("File \"bs_array_test.res\", line 304, characters 5-12", c, [ - 0, - 1, - 2 - ]); + 0, + 1, + 2 +]); eq("File \"bs_array_test.res\", line 308, characters 5-12", Belt_Array.zip([ - 1, - 2, - 3 - ], [ - 2, - 3, - 4, - 1 - ]), [ - [ - 1, - 2 - ], - [ - 2, - 3 - ], - [ - 3, - 4 - ] - ]); + 1, + 2, + 3 +], [ + 2, + 3, + 4, + 1 +]), [ + [ + 1, + 2 + ], + [ + 2, + 3 + ], + [ + 3, + 4 + ] +]); eq("File \"bs_array_test.res\", line 309, characters 5-12", Belt_Array.zip([ - 2, - 3, - 4, - 1 - ], [ - 1, - 2, - 3 - ]), [ - [ - 2, - 1 - ], - [ - 3, - 2 - ], - [ - 4, - 3 - ] - ]); + 2, + 3, + 4, + 1 +], [ + 1, + 2, + 3 +]), [ + [ + 2, + 1 + ], + [ + 3, + 2 + ], + [ + 4, + 3 + ] +]); eq("File \"bs_array_test.res\", line 310, characters 5-12", Belt_Array.zipBy([ - 2, - 3, - 4, - 1 - ], [ - 1, - 2, - 3 - ], (function (prim0, prim1) { - return prim0 - prim1 | 0; - })), [ - 1, - 1, - 1 - ]); + 2, + 3, + 4, + 1 +], [ + 1, + 2, + 3 +], (function (prim0, prim1) { + return prim0 - prim1 | 0; +})), [ + 1, + 1, + 1 +]); eq("File \"bs_array_test.res\", line 311, characters 5-12", Belt_Array.zipBy([ - 1, - 2, - 3 - ], [ - 2, - 3, - 4, - 1 - ], (function (prim0, prim1) { - return prim0 - prim1 | 0; - })), Belt_Array.map([ - 1, - 1, - 1 - ], (function (x) { - return -x | 0; - }))); + 1, + 2, + 3 +], [ + 2, + 3, + 4, + 1 +], (function (prim0, prim1) { + return prim0 - prim1 | 0; +})), Belt_Array.map([ + 1, + 1, + 1 +], (function (x) { + return -x | 0; +}))); eq("File \"bs_array_test.res\", line 312, characters 5-12", Belt_Array.unzip([ - [ - 1, - 2 - ], - [ - 2, - 3 - ], - [ - 3, - 4 - ] - ]), [ - [ - 1, - 2, - 3 - ], - [ - 2, - 3, - 4 - ] - ]); + [ + 1, + 2 + ], + [ + 2, + 3 + ], + [ + 3, + 4 + ] +]), [ + [ + 1, + 2, + 3 + ], + [ + 2, + 3, + 4 + ] +]); function sumUsingForEach(xs) { var v = { contents: 0 }; Belt_Array.forEach(xs, (function (x) { - v.contents = v.contents + x | 0; - })); + v.contents = v.contents + x | 0; + })); return v.contents; } eq("File \"bs_array_test.res\", line 324, characters 5-12", sumUsingForEach([ - 0, - 1, - 2, - 3, - 4 - ]), 10); + 0, + 1, + 2, + 3, + 4 +]), 10); b("File \"bs_array_test.res\", line 325, characters 4-11", !Belt_Array.every([ - 0, - 1, - 2, - 3, - 4 - ], (function (x) { - return x > 2; - }))); + 0, + 1, + 2, + 3, + 4 +], (function (x) { + return x > 2; +}))); b("File \"bs_array_test.res\", line 326, characters 4-11", Belt_Array.some([ - 1, - 3, - 7, - 8 - ], (function (x) { - return x % 2 === 0; - }))); + 1, + 3, + 7, + 8 +], (function (x) { + return x % 2 === 0; +}))); b("File \"bs_array_test.res\", line 327, characters 4-11", !Belt_Array.some([ - 1, - 3, - 7 - ], (function (x) { - return x % 2 === 0; - }))); + 1, + 3, + 7 +], (function (x) { + return x % 2 === 0; +}))); b("File \"bs_array_test.res\", line 328, characters 4-11", !Belt_Array.eq([ - 0, - 1 - ], [1], (function (prim0, prim1) { - return prim0 === prim1; - }))); + 0, + 1 +], [1], (function (prim0, prim1) { + return prim0 === prim1; +}))); var c$1 = { contents: 0 }; b("File \"bs_array_test.res\", line 330, characters 4-11", (Belt_Array.forEachWithIndex([ - 1, - 1, - 1 - ], (function (i, v) { - c$1.contents = (c$1.contents + i | 0) + v | 0; - })), c$1.contents === 6)); + 1, + 1, + 1 +], (function (i, v) { + c$1.contents = (c$1.contents + i | 0) + v | 0; +})), c$1.contents === 6)); function id$1(loc, x) { var u = x.slice(0); @@ -1255,22 +1255,22 @@ id$1("File \"bs_array_test.res\", line 351, characters 5-12", []); id$1("File \"bs_array_test.res\", line 352, characters 5-12", [1]); id$1("File \"bs_array_test.res\", line 353, characters 5-12", [ - 1, - 2 - ]); + 1, + 2 +]); id$1("File \"bs_array_test.res\", line 354, characters 5-12", [ - 1, - 2, - 3 - ]); + 1, + 2, + 3 +]); id$1("File \"bs_array_test.res\", line 355, characters 5-12", [ - 1, - 2, - 3, - 4 - ]); + 1, + 2, + 3, + 4 +]); function every2(xs, ys) { var partial_arg = Belt_List.toArray(ys); @@ -1289,311 +1289,311 @@ function some2(xs, ys) { } eq("File \"bs_array_test.res\", line 363, characters 5-12", every2(/* [] */0, { - hd: 1, - tl: /* [] */0 - })(function (x, y) { - return x > y; - }), true); + hd: 1, + tl: /* [] */0 +})(function (x, y) { + return x > y; +}), true); eq("File \"bs_array_test.res\", line 364, characters 5-12", every2({ - hd: 2, - tl: { - hd: 3, - tl: /* [] */0 - } - }, { - hd: 1, - tl: /* [] */0 - })(function (x, y) { - return x > y; - }), true); + hd: 2, + tl: { + hd: 3, + tl: /* [] */0 + } +}, { + hd: 1, + tl: /* [] */0 +})(function (x, y) { + return x > y; +}), true); eq("File \"bs_array_test.res\", line 365, characters 5-12", every2({ - hd: 2, - tl: /* [] */0 - }, { - hd: 1, - tl: /* [] */0 - })(function (x, y) { - return x > y; - }), true); + hd: 2, + tl: /* [] */0 +}, { + hd: 1, + tl: /* [] */0 +})(function (x, y) { + return x > y; +}), true); eq("File \"bs_array_test.res\", line 366, characters 5-12", every2({ - hd: 2, - tl: { - hd: 3, - tl: /* [] */0 - } - }, { - hd: 1, - tl: { - hd: 4, - tl: /* [] */0 - } - })(function (x, y) { - return x > y; - }), false); + hd: 2, + tl: { + hd: 3, + tl: /* [] */0 + } +}, { + hd: 1, + tl: { + hd: 4, + tl: /* [] */0 + } +})(function (x, y) { + return x > y; +}), false); eq("File \"bs_array_test.res\", line 367, characters 5-12", every2({ - hd: 2, - tl: { - hd: 3, - tl: /* [] */0 - } - }, { - hd: 1, - tl: { - hd: 0, - tl: /* [] */0 - } - })(function (x, y) { - return x > y; - }), true); + hd: 2, + tl: { + hd: 3, + tl: /* [] */0 + } +}, { + hd: 1, + tl: { + hd: 0, + tl: /* [] */0 + } +})(function (x, y) { + return x > y; +}), true); eq("File \"bs_array_test.res\", line 368, characters 5-12", some2(/* [] */0, { - hd: 1, - tl: /* [] */0 - })(function (x, y) { - return x > y; - }), false); + hd: 1, + tl: /* [] */0 +})(function (x, y) { + return x > y; +}), false); eq("File \"bs_array_test.res\", line 369, characters 5-12", some2({ - hd: 2, - tl: { - hd: 3, - tl: /* [] */0 - } - }, { - hd: 1, - tl: /* [] */0 - })(function (x, y) { - return x > y; - }), true); + hd: 2, + tl: { + hd: 3, + tl: /* [] */0 + } +}, { + hd: 1, + tl: /* [] */0 +})(function (x, y) { + return x > y; +}), true); eq("File \"bs_array_test.res\", line 370, characters 5-12", some2({ - hd: 2, - tl: { - hd: 3, - tl: /* [] */0 - } - }, { - hd: 1, - tl: { - hd: 4, - tl: /* [] */0 - } - })(function (x, y) { - return x > y; - }), true); + hd: 2, + tl: { + hd: 3, + tl: /* [] */0 + } +}, { + hd: 1, + tl: { + hd: 4, + tl: /* [] */0 + } +})(function (x, y) { + return x > y; +}), true); eq("File \"bs_array_test.res\", line 371, characters 5-12", some2({ - hd: 0, - tl: { - hd: 3, - tl: /* [] */0 - } - }, { - hd: 1, - tl: { - hd: 4, - tl: /* [] */0 - } - })(function (x, y) { - return x > y; - }), false); + hd: 0, + tl: { + hd: 3, + tl: /* [] */0 + } +}, { + hd: 1, + tl: { + hd: 4, + tl: /* [] */0 + } +})(function (x, y) { + return x > y; +}), false); eq("File \"bs_array_test.res\", line 372, characters 5-12", some2({ - hd: 0, - tl: { - hd: 3, - tl: /* [] */0 - } - }, { - hd: 3, - tl: { - hd: 2, - tl: /* [] */0 - } - })(function (x, y) { - return x > y; - }), true); + hd: 0, + tl: { + hd: 3, + tl: /* [] */0 + } +}, { + hd: 3, + tl: { + hd: 2, + tl: /* [] */0 + } +})(function (x, y) { + return x > y; +}), true); eq("File \"bs_array_test.res\", line 376, characters 5-12", Belt_Array.concat([], [ - 1, - 2, - 3 - ]), [ - 1, - 2, - 3 - ]); + 1, + 2, + 3 +]), [ + 1, + 2, + 3 +]); eq("File \"bs_array_test.res\", line 377, characters 5-12", Belt_Array.concat([], []), []); eq("File \"bs_array_test.res\", line 378, characters 5-12", Belt_Array.concat([ - 3, - 2 - ], [ - 1, - 2, - 3 - ]), [ - 3, - 2, - 1, - 2, - 3 - ]); + 3, + 2 +], [ + 1, + 2, + 3 +]), [ + 3, + 2, + 1, + 2, + 3 +]); eq("File \"bs_array_test.res\", line 379, characters 5-12", Belt_Array.concatMany([ - [ - 3, - 2 - ], - [ - 1, - 2, - 3 - ] - ]), [ - 3, - 2, - 1, - 2, - 3 - ]); + [ + 3, + 2 + ], + [ + 1, + 2, + 3 + ] +]), [ + 3, + 2, + 1, + 2, + 3 +]); eq("File \"bs_array_test.res\", line 380, characters 5-12", Belt_Array.concatMany([ - [ - 3, - 2 - ], - [ - 1, - 2, - 3 - ], - [], - [0] - ]), [ - 3, - 2, - 1, - 2, - 3, - 0 - ]); + [ + 3, + 2 + ], + [ + 1, + 2, + 3 + ], + [], + [0] +]), [ + 3, + 2, + 1, + 2, + 3, + 0 +]); eq("File \"bs_array_test.res\", line 381, characters 5-12", Belt_Array.concatMany([ - [], - [ - 3, - 2 - ], - [ - 1, - 2, - 3 - ], - [], - [0] - ]), [ - 3, - 2, - 1, - 2, - 3, - 0 - ]); + [], + [ + 3, + 2 + ], + [ + 1, + 2, + 3 + ], + [], + [0] +]), [ + 3, + 2, + 1, + 2, + 3, + 0 +]); eq("File \"bs_array_test.res\", line 382, characters 5-12", Belt_Array.concatMany([ - [], - [] - ]), []); + [], + [] +]), []); b("File \"bs_array_test.res\", line 386, characters 4-11", Belt_Array.cmp([ - 1, - 2, - 3 - ], [ - 0, - 1, - 2, - 3 - ], Caml.int_compare) < 0); + 1, + 2, + 3 +], [ + 0, + 1, + 2, + 3 +], Caml.int_compare) < 0); b("File \"bs_array_test.res\", line 387, characters 4-11", Belt_Array.cmp([ - 0, - 1, - 2, - 3 - ], [ - 1, - 2, - 3 - ], Caml.int_compare) > 0); + 0, + 1, + 2, + 3 +], [ + 1, + 2, + 3 +], Caml.int_compare) > 0); b("File \"bs_array_test.res\", line 388, characters 4-11", Belt_Array.cmp([ - 1, - 2, - 3 - ], [ - 0, - 1, - 2 - ], Caml.int_compare) > 0); + 1, + 2, + 3 +], [ + 0, + 1, + 2 +], Caml.int_compare) > 0); b("File \"bs_array_test.res\", line 389, characters 4-11", Belt_Array.cmp([ - 1, - 2, - 3 - ], [ - 1, - 2, - 3 - ], Caml.int_compare) === 0); + 1, + 2, + 3 +], [ + 1, + 2, + 3 +], Caml.int_compare) === 0); b("File \"bs_array_test.res\", line 390, characters 4-11", Belt_Array.cmp([ - 1, - 2, - 4 - ], [ - 1, - 2, - 3 - ], Caml.int_compare) > 0); + 1, + 2, + 4 +], [ + 1, + 2, + 3 +], Caml.int_compare) > 0); eq("File \"bs_array_test.res\", line 394, characters 5-12", Belt_Array.getBy([ - 1, - 2, - 3 - ], (function (x) { - return x > 1; - })), 2); + 1, + 2, + 3 +], (function (x) { + return x > 1; +})), 2); eq("File \"bs_array_test.res\", line 395, characters 5-12", Belt_Array.getBy([ - 1, - 2, - 3 - ], (function (x) { - return x > 3; - })), undefined); + 1, + 2, + 3 +], (function (x) { + return x > 3; +})), undefined); eq("File \"bs_array_test.res\", line 399, characters 5-12", Belt_Array.getIndexBy([ - 1, - 2, - 3 - ], (function (x) { - return x > 1; - })), 1); + 1, + 2, + 3 +], (function (x) { + return x > 1; +})), 1); eq("File \"bs_array_test.res\", line 400, characters 5-12", Belt_Array.getIndexBy([ - 1, - 2, - 3 - ], (function (x) { - return x > 3; - })), undefined); + 1, + 2, + 3 +], (function (x) { + return x > 3; +})), undefined); var arr = []; @@ -1604,10 +1604,10 @@ arr.push(2); arr.push(1); eq("File \"bs_array_test.res\", line 408, characters 5-12", arr, [ - 3, - 2, - 1 - ]); + 3, + 2, + 1 +]); Mt.from_pair_suites("File \"bs_array_test.res\", line 411, characters 20-27", suites.contents); diff --git a/jscomp/test/bs_auto_uncurry.js b/jscomp/test/bs_auto_uncurry.js index a5814f178b..1d8eb87f75 100644 --- a/jscomp/test/bs_auto_uncurry.js +++ b/jscomp/test/bs_auto_uncurry.js @@ -9,54 +9,54 @@ var Curry$1 = {}; var Block = {}; var xbs = Array.prototype.map.call([ - 1, - 2, - 3, - 5 - ], (function (x) { - return x + 1 | 0; - })); + 1, + 2, + 3, + 5 +], (function (x) { + return x + 1 | 0; +})); function f(cb) { return Array.prototype.map.call([ - 1, - 2, - 3, - 4 - ], Curry.__1(cb)); + 1, + 2, + 3, + 4 + ], Curry.__1(cb)); } var xs = Array.prototype.map.call([ - 1, - 1, - 2 - ], (function (x) { - return function (y) { - return (y + x | 0) + 1 | 0; - }; - })); + 1, + 1, + 2 +], (function (x) { + return function (y) { + return (y + x | 0) + 1 | 0; + }; +})); function f_0(param) { return hi(function (param) { - - }); + + }); } function f_01(param) { return hi(function (x) { - if (x === undefined) { - console.log("x"); - return; - } - - }); + if (x === undefined) { + console.log("x"); + return; + } + + }); } function f_02(xs) { return hi(function (x) { - xs.contents = x; - console.log("x"); - }); + xs.contents = x; + console.log("x"); + }); } function f_03(xs, u) { @@ -82,33 +82,33 @@ function add3(x, y, z) { function h2(x) { return ff(x, (function (prim0, prim1) { - return prim0 + prim1 | 0; - })); + return prim0 + prim1 | 0; + })); } function h3(x) { return ff(x, (function (param, param$1) { - return add3(1, param, param$1); - })); + return add3(1, param, param$1); + })); } function h4(x) { return ff1(x, 3, (function (param, param$1) { - return add3(1, param, param$1); - })); + return add3(1, param, param$1); + })); } function h5(x) { return ff2(x, "3", (function (param, param$1) { - return add3(2, param, param$1); - })); + return add3(2, param, param$1); + })); } function add(x, y) { console.log([ - x, - y - ]); + x, + y + ]); return x + y | 0; } @@ -127,9 +127,9 @@ var f_unit_magic = unit_magic(); function hh(xs) { return function (param) { Caml_splice_call.spliceApply(f_0002, [ - xs, - param - ]); + xs, + param + ]); }; } diff --git a/jscomp/test/bs_auto_uncurry_test.js b/jscomp/test/bs_auto_uncurry_test.js index f20547212c..d965725a81 100644 --- a/jscomp/test/bs_auto_uncurry_test.js +++ b/jscomp/test/bs_auto_uncurry_test.js @@ -17,12 +17,12 @@ function eq(loc, x, y) { hd: [ loc + (" id " + String(test_id.contents)), (function (param) { - return { - TAG: "Eq", - _0: x, - _1: y - }; - }) + return { + TAG: "Eq", + _0: x, + _1: y + }; + }) ], tl: suites.contents }; @@ -39,82 +39,82 @@ var xs = { }; hi(function (x) { - xs.contents = { - hd: x, - tl: xs.contents - }; - }); + xs.contents = { + hd: x, + tl: xs.contents + }; +}); hi(function (x) { - xs.contents = { - hd: x, - tl: xs.contents - }; - }); + xs.contents = { + hd: x, + tl: xs.contents + }; +}); eq("File \"bs_auto_uncurry_test.res\", line 24, characters 5-12", xs.contents, { - hd: undefined, - tl: { - hd: undefined, - tl: /* [] */0 - } - }); + hd: undefined, + tl: { + hd: undefined, + tl: /* [] */0 + } +}); eq("File \"bs_auto_uncurry_test.res\", line 28, characters 5-12", [ - 1, - 2, - 3 - ].map(function (x) { - return x + 1 | 0; - }), [ - 2, - 3, - 4 - ]); + 1, + 2, + 3 +].map(function (x) { + return x + 1 | 0; +}), [ + 2, + 3, + 4 +]); eq("File \"bs_auto_uncurry_test.res\", line 29, characters 5-12", [ - 1, - 2, - 3 - ].map(function (x) { - return x + 1 | 0; - }), [ - 2, - 3, - 4 - ]); + 1, + 2, + 3 +].map(function (x) { + return x + 1 | 0; +}), [ + 2, + 3, + 4 +]); eq("File \"bs_auto_uncurry_test.res\", line 31, characters 5-12", [ - 1, - 2, - 3 - ].reduce((function (prim0, prim1) { - return prim0 + prim1 | 0; - }), 0), 6); + 1, + 2, + 3 +].reduce((function (prim0, prim1) { + return prim0 + prim1 | 0; +}), 0), 6); eq("File \"bs_auto_uncurry_test.res\", line 33, characters 5-12", [ - 1, - 2, - 3 - ].reduce((function (x, y, i) { - return (x + y | 0) + i | 0; - }), 0), 9); + 1, + 2, + 3 +].reduce((function (x, y, i) { + return (x + y | 0) + i | 0; +}), 0), 9); eq("File \"bs_auto_uncurry_test.res\", line 35, characters 5-12", [ - 1, - 2, - 3 - ].some(function (x) { - return x < 1; - }), false); + 1, + 2, + 3 +].some(function (x) { + return x < 1; +}), false); eq("File \"bs_auto_uncurry_test.res\", line 37, characters 5-12", [ - 1, - 2, - 3 - ].every(function (x) { - return x > 0; - }), true); + 1, + 2, + 3 +].every(function (x) { + return x > 0; +}), true); Mt.from_pair_suites("Bs_auto_uncurry_test", suites.contents); diff --git a/jscomp/test/bs_float_test.js b/jscomp/test/bs_float_test.js index 2322ef8c00..ea3940d789 100644 --- a/jscomp/test/bs_float_test.js +++ b/jscomp/test/bs_float_test.js @@ -30,12 +30,12 @@ function neq(loc, x, y) { hd: [ loc + (" id " + String(test_id.contents)), (function (param) { - return { - TAG: "Neq", - _0: x, - _1: y - }; - }) + return { + TAG: "Neq", + _0: x, + _1: y + }; + }) ], tl: suites.contents }; diff --git a/jscomp/test/bs_hashmap_test.js b/jscomp/test/bs_hashmap_test.js index 10c30c94cc..b5ebd4a8d1 100644 --- a/jscomp/test/bs_hashmap_test.js +++ b/jscomp/test/bs_hashmap_test.js @@ -44,23 +44,23 @@ function add(prim0, prim1) { } Belt_HashMap.mergeMany(empty, [ - [ - 1, - 1 - ], - [ - 2, - 3 - ], - [ - 3, - 3 - ], - [ - 2, - 2 - ] - ]); + [ + 1, + 1 + ], + [ + 2, + 3 + ], + [ + 3, + 3 + ], + [ + 2, + 2 + ] +]); eqx("File \"bs_hashmap_test.res\", line 30, characters 6-13", Belt_HashMap.get(empty, 2), 2); @@ -97,8 +97,8 @@ for(var i$1 = 0; i$1 <= 2000; ++i$1){ eqx("File \"bs_hashmap_test.res\", line 57, characters 6-13", v$1.size, 98000); b("File \"bs_hashmap_test.res\", line 58, characters 4-11", Belt_Array.every(Array_data_util.range(2001, 100000), (function (x) { - return Belt_HashMap.has(v$1, x); - }))); + return Belt_HashMap.has(v$1, x); +}))); Mt.from_pair_suites("Bs_hashmap_test", suites.contents); diff --git a/jscomp/test/bs_hashset_int_test.js b/jscomp/test/bs_hashset_int_test.js index f75660f9cc..d15ad075ba 100644 --- a/jscomp/test/bs_hashset_int_test.js +++ b/jscomp/test/bs_hashset_int_test.js @@ -34,8 +34,8 @@ function sum2(h) { contents: 0 }; Belt_HashSetInt.forEach(h, (function (x) { - v.contents = v.contents + x | 0; - })); + v.contents = v.contents + x | 0; + })); return v.contents; } diff --git a/jscomp/test/bs_hashtbl_string_test.js b/jscomp/test/bs_hashtbl_string_test.js index ed2ab79b2b..2b3d29e775 100644 --- a/jscomp/test/bs_hashtbl_string_test.js +++ b/jscomp/test/bs_hashtbl_string_test.js @@ -26,22 +26,22 @@ var hashString = (function(str){ return hash}); var $$String = Belt_Id.hashable(Hashtbl.hash, (function (x, y) { - return x === y; - })); + return x === y; +})); var String1 = Belt_Id.hashable(hashString, (function (x, y) { - return x === y; - })); + return x === y; +})); var String2 = Belt_Id.hashable((function (x) { - return Caml_hash_primitive.hash_final_mix(Caml_hash_primitive.hash_mix_string(0, x)); - }), (function (x, y) { - return x === y; - })); + return Caml_hash_primitive.hash_final_mix(Caml_hash_primitive.hash_mix_string(0, x)); +}), (function (x, y) { + return x === y; +})); var Int = Belt_Id.hashable(Hashtbl.hash, (function (x, y) { - return x === y; - })); + return x === y; +})); var empty = Belt_internalBucketsType.make(Int.hash, Int.eq, 500000); diff --git a/jscomp/test/bs_ignore_effect.js b/jscomp/test/bs_ignore_effect.js index 06a86d8fc5..42e21c8a57 100644 --- a/jscomp/test/bs_ignore_effect.js +++ b/jscomp/test/bs_ignore_effect.js @@ -17,12 +17,12 @@ function eq(loc, x, y) { hd: [ loc + (" id " + String(test_id.contents)), (function (param) { - return { - TAG: "Eq", - _0: x, - _1: y - }; - }) + return { + TAG: "Eq", + _0: x, + _1: y + }; + }) ], tl: suites.contents }; @@ -38,9 +38,9 @@ var v = { }; var h = (v.contents = v.contents + 1 | 0, { - hi: 2, - lo: 0 - }); + hi: 2, + lo: 0 +}); var z = (v.contents = v.contents + 1 | 0, "Float", add(3.0, 2.0)); diff --git a/jscomp/test/bs_int_test.js b/jscomp/test/bs_int_test.js index 8ba8800a0f..cd30e35d2f 100644 --- a/jscomp/test/bs_int_test.js +++ b/jscomp/test/bs_int_test.js @@ -30,12 +30,12 @@ function neq(loc, x, y) { hd: [ loc + (" id " + String(test_id.contents)), (function (param) { - return { - TAG: "Neq", - _0: x, - _1: y - }; - }) + return { + TAG: "Neq", + _0: x, + _1: y + }; + }) ], tl: suites.contents }; diff --git a/jscomp/test/bs_list_test.js b/jscomp/test/bs_list_test.js index 0aa415b6d1..bee9d6169e 100644 --- a/jscomp/test/bs_list_test.js +++ b/jscomp/test/bs_list_test.js @@ -32,8 +32,8 @@ function sum(xs) { contents: 0 }; Belt_List.forEach(xs, (function (x) { - v.contents = v.contents + x | 0; - })); + v.contents = v.contents + x | 0; + })); return v.contents; } @@ -42,14 +42,14 @@ function sum2(xs, ys) { contents: 0 }; Belt_List.forEach2(xs, ys, (function (x, y) { - v.contents = (v.contents + x | 0) + y | 0; - })); + v.contents = (v.contents + x | 0) + y | 0; + })); return v.contents; } var u = Belt_List.makeBy(5, (function (i) { - return Math.imul(i, i); - })); + return Math.imul(i, i); +})); function f(i) { eq("File \"bs_list_test.res\", line 27, characters 18-25", Belt_List.getExn(u, i), Math.imul(i, i)); @@ -60,377 +60,377 @@ for(var i = 0; i <= 4; ++i){ } eq("File \"bs_list_test.res\", line 31, characters 5-12", Belt_List.map(u, (function (i) { - return i + 1 | 0; - })), { - hd: 1, + return i + 1 | 0; +})), { + hd: 1, + tl: { + hd: 2, + tl: { + hd: 5, tl: { - hd: 2, + hd: 10, tl: { - hd: 5, - tl: { - hd: 10, - tl: { - hd: 17, - tl: /* [] */0 - } - } + hd: 17, + tl: /* [] */0 } } - }); + } + } +}); eq("File \"bs_list_test.res\", line 32, characters 5-12", Belt_List.getBy({ - hd: 1, - tl: { - hd: 4, - tl: { - hd: 3, - tl: { - hd: 2, - tl: /* [] */0 - } - } - } - }, (function (x) { - return x % 2 === 0; - })), 4); + hd: 1, + tl: { + hd: 4, + tl: { + hd: 3, + tl: { + hd: 2, + tl: /* [] */0 + } + } + } +}, (function (x) { + return x % 2 === 0; +})), 4); eq("File \"bs_list_test.res\", line 33, characters 5-12", Belt_List.getBy({ - hd: 1, - tl: { - hd: 4, - tl: { - hd: 3, - tl: { - hd: 2, - tl: /* [] */0 - } - } - } - }, (function (x) { - return x % 5 === 0; - })), undefined); - -eq("FLATTEN", Belt_List.flatten({ - hd: { - hd: 1, - tl: /* [] */0 - }, - tl: { - hd: { - hd: 2, - tl: /* [] */0 - }, - tl: { - hd: { - hd: 3, - tl: /* [] */0 - }, - tl: { - hd: /* [] */0, - tl: { - hd: Belt_List.makeBy(4, (function (i) { - return i; - })), - tl: /* [] */0 - } - } - } - } - }), { - hd: 1, + hd: 1, + tl: { + hd: 4, + tl: { + hd: 3, tl: { hd: 2, - tl: { - hd: 3, - tl: { - hd: 0, - tl: { - hd: 1, - tl: { - hd: 2, - tl: { - hd: 3, - tl: /* [] */0 - } - } - } - } - } + tl: /* [] */0 } - }); - -eq("FLATTEN", Belt_List.flatten(/* [] */0), /* [] */0); + } + } +}, (function (x) { + return x % 5 === 0; +})), undefined); eq("FLATTEN", Belt_List.flatten({ - hd: /* [] */0, - tl: { - hd: /* [] */0, - tl: { - hd: { - hd: 2, - tl: /* [] */0 - }, - tl: { - hd: { - hd: 1, - tl: /* [] */0 - }, - tl: { - hd: { - hd: 2, - tl: /* [] */0 - }, - tl: { - hd: /* [] */0, - tl: /* [] */0 - } - } - } - } - } - }), { + hd: { + hd: 1, + tl: /* [] */0 + }, + tl: { + hd: { hd: 2, + tl: /* [] */0 + }, + tl: { + hd: { + hd: 3, + tl: /* [] */0 + }, tl: { - hd: 1, + hd: /* [] */0, tl: { - hd: 2, + hd: Belt_List.makeBy(4, (function (i) { + return i; + })), tl: /* [] */0 } } - }); - -eq("CONCATMANY", Belt_List.concatMany([ - { - hd: 1, - tl: /* [] */0 - }, - { - hd: 2, - tl: /* [] */0 - }, - { - hd: 3, - tl: /* [] */0 - }, - /* [] */0, - Belt_List.makeBy(4, (function (i) { - return i; - })) - ]), { - hd: 1, + } + } +}), { + hd: 1, + tl: { + hd: 2, + tl: { + hd: 3, tl: { - hd: 2, + hd: 0, tl: { - hd: 3, + hd: 1, tl: { - hd: 0, + hd: 2, tl: { - hd: 1, - tl: { - hd: 2, - tl: { - hd: 3, - tl: /* [] */0 - } - } + hd: 3, + tl: /* [] */0 } } } } - }); + } + } +}); -eq("CONCATMANY", Belt_List.concatMany([]), /* [] */0); +eq("FLATTEN", Belt_List.flatten(/* [] */0), /* [] */0); -eq("CONCATMANY", Belt_List.concatMany([ - /* [] */0, - /* [] */0, - { +eq("FLATTEN", Belt_List.flatten({ + hd: /* [] */0, + tl: { + hd: /* [] */0, + tl: { + hd: { + hd: 2, + tl: /* [] */0 + }, + tl: { + hd: { + hd: 1, + tl: /* [] */0 + }, + tl: { + hd: { hd: 2, tl: /* [] */0 }, - { - hd: 1, - tl: /* [] */0 - }, - { - hd: 2, + tl: { + hd: /* [] */0, tl: /* [] */0 - }, - /* [] */0 - ]), { - hd: 2, - tl: { - hd: 1, - tl: { - hd: 2, - tl: /* [] */0 + } } } - }); + } + } +}), { + hd: 2, + tl: { + hd: 1, + tl: { + hd: 2, + tl: /* [] */0 + } + } +}); eq("CONCATMANY", Belt_List.concatMany([ - /* [] */0, - /* [] */0, - { - hd: 2, - tl: { - hd: 3, - tl: /* [] */0 - } - }, - { - hd: 1, - tl: /* [] */0 - }, - { - hd: 2, - tl: /* [] */0 - }, - /* [] */0 - ]), { - hd: 2, + { + hd: 1, + tl: /* [] */0 + }, + { + hd: 2, + tl: /* [] */0 + }, + { + hd: 3, + tl: /* [] */0 + }, + /* [] */0, + Belt_List.makeBy(4, (function (i) { + return i; + })) +]), { + hd: 1, + tl: { + hd: 2, + tl: { + hd: 3, tl: { - hd: 3, + hd: 0, tl: { hd: 1, tl: { hd: 2, - tl: /* [] */0 + tl: { + hd: 3, + tl: /* [] */0 + } } } } - }); + } + } +}); -eq("CONCATMANY", Belt_List.concatMany([{ - hd: 1, - tl: { - hd: 2, - tl: { - hd: 3, - tl: /* [] */0 - } - } - }]), { +eq("CONCATMANY", Belt_List.concatMany([]), /* [] */0); + +eq("CONCATMANY", Belt_List.concatMany([ + /* [] */0, + /* [] */0, + { + hd: 2, + tl: /* [] */0 + }, + { + hd: 1, + tl: /* [] */0 + }, + { + hd: 2, + tl: /* [] */0 + }, + /* [] */0 +]), { + hd: 2, + tl: { + hd: 1, + tl: { + hd: 2, + tl: /* [] */0 + } + } +}); + +eq("CONCATMANY", Belt_List.concatMany([ + /* [] */0, + /* [] */0, + { + hd: 2, + tl: { + hd: 3, + tl: /* [] */0 + } + }, + { + hd: 1, + tl: /* [] */0 + }, + { + hd: 2, + tl: /* [] */0 + }, + /* [] */0 +]), { + hd: 2, + tl: { + hd: 3, + tl: { hd: 1, tl: { hd: 2, - tl: { - hd: 3, - tl: /* [] */0 - } + tl: /* [] */0 + } + } + } +}); + +eq("CONCATMANY", Belt_List.concatMany([{ + hd: 1, + tl: { + hd: 2, + tl: { + hd: 3, + tl: /* [] */0 } - }); + } + }]), { + hd: 1, + tl: { + hd: 2, + tl: { + hd: 3, + tl: /* [] */0 + } + } +}); eq("File \"bs_list_test.res\", line 66, characters 2-9", Belt_List.toArray(Belt_List.concat(Belt_List.makeBy(100, (function (i) { - return i; - })), Belt_List.makeBy(100, (function (i) { - return i; - })))), Belt_Array.concat(Belt_Array.makeBy(100, (function (i) { - return i; - })), Belt_Array.makeBy(100, (function (i) { - return i; - })))); + return i; +})), Belt_List.makeBy(100, (function (i) { + return i; +})))), Belt_Array.concat(Belt_Array.makeBy(100, (function (i) { + return i; +})), Belt_Array.makeBy(100, (function (i) { + return i; +})))); eq("APPEND", Belt_List.concat({ - hd: 1, - tl: /* [] */0 - }, /* [] */0), { - hd: 1, - tl: /* [] */0 - }); + hd: 1, + tl: /* [] */0 +}, /* [] */0), { + hd: 1, + tl: /* [] */0 +}); eq("APPEND", Belt_List.concat(/* [] */0, { - hd: 1, - tl: /* [] */0 - }), { - hd: 1, - tl: /* [] */0 - }); + hd: 1, + tl: /* [] */0 +}), { + hd: 1, + tl: /* [] */0 +}); eq("ZIP", Belt_List.zip({ - hd: 1, - tl: { - hd: 2, - tl: { - hd: 3, - tl: /* [] */0 - } - } - }, { - hd: 3, - tl: { - hd: 4, - tl: /* [] */0 - } - }), { - hd: [ - 1, - 3 - ], - tl: { - hd: [ - 2, - 4 - ], - tl: /* [] */0 - } - }); + hd: 1, + tl: { + hd: 2, + tl: { + hd: 3, + tl: /* [] */0 + } + } +}, { + hd: 3, + tl: { + hd: 4, + tl: /* [] */0 + } +}), { + hd: [ + 1, + 3 + ], + tl: { + hd: [ + 2, + 4 + ], + tl: /* [] */0 + } +}); eq("ZIP", Belt_List.zip(/* [] */0, { - hd: 1, - tl: /* [] */0 - }), /* [] */0); + hd: 1, + tl: /* [] */0 +}), /* [] */0); eq("ZIP", Belt_List.zip(/* [] */0, /* [] */0), /* [] */0); eq("ZIP", Belt_List.zip({ - hd: 1, - tl: { - hd: 2, - tl: { - hd: 3, - tl: /* [] */0 - } - } - }, /* [] */0), /* [] */0); + hd: 1, + tl: { + hd: 2, + tl: { + hd: 3, + tl: /* [] */0 + } + } +}, /* [] */0), /* [] */0); eq("ZIP", Belt_List.zip({ - hd: 1, - tl: { - hd: 2, - tl: { - hd: 3, - tl: /* [] */0 - } - } - }, { - hd: 2, - tl: { - hd: 3, - tl: { - hd: 4, - tl: /* [] */0 - } - } - }), { + hd: 1, + tl: { + hd: 2, + tl: { + hd: 3, + tl: /* [] */0 + } + } +}, { + hd: 2, + tl: { + hd: 3, + tl: { + hd: 4, + tl: /* [] */0 + } + } +}), { + hd: [ + 1, + 2 + ], + tl: { + hd: [ + 2, + 3 + ], + tl: { hd: [ - 1, - 2 + 3, + 4 ], - tl: { - hd: [ - 2, - 3 - ], - tl: { - hd: [ - 3, - 4 - ], - tl: /* [] */0 - } - } - }); + tl: /* [] */0 + } + } +}); function mod2(x) { return x % 2 === 0; @@ -441,321 +441,321 @@ function evenIndex(_x, i) { } eq("PARTITION", Belt_List.partition({ - hd: 1, - tl: { - hd: 2, - tl: { - hd: 3, - tl: { - hd: 2, - tl: { - hd: 3, - tl: { - hd: 4, - tl: /* [] */0 - } - } - } - } - } - }, mod2), [ - { + hd: 1, + tl: { + hd: 2, + tl: { + hd: 3, + tl: { hd: 2, - tl: { - hd: 2, - tl: { - hd: 4, - tl: /* [] */0 - } - } - }, - { - hd: 1, tl: { hd: 3, tl: { - hd: 3, + hd: 4, tl: /* [] */0 } } } - ]); + } + } +}, mod2), [ + { + hd: 2, + tl: { + hd: 2, + tl: { + hd: 4, + tl: /* [] */0 + } + } + }, + { + hd: 1, + tl: { + hd: 3, + tl: { + hd: 3, + tl: /* [] */0 + } + } + } +]); eq("PARTITION", Belt_List.partition({ - hd: 2, - tl: { - hd: 2, - tl: { - hd: 2, - tl: { - hd: 4, - tl: /* [] */0 - } - } - } - }, mod2), [ - { + hd: 2, + tl: { + hd: 2, + tl: { + hd: 2, + tl: { + hd: 4, + tl: /* [] */0 + } + } + } +}, mod2), [ + { + hd: 2, + tl: { + hd: 2, + tl: { hd: 2, tl: { - hd: 2, - tl: { - hd: 2, - tl: { - hd: 4, - tl: /* [] */0 - } - } + hd: 4, + tl: /* [] */0 } - }, - /* [] */0 - ]); + } + } + }, + /* [] */0 +]); eq("PARTITION", Belt_List.partition({ - hd: 2, - tl: { - hd: 2, - tl: { - hd: 2, - tl: { - hd: 4, - tl: /* [] */0 - } - } - } - }, (function (x) { - return !mod2(x); - })), [ - /* [] */0, - { + hd: 2, + tl: { + hd: 2, + tl: { + hd: 2, + tl: { + hd: 4, + tl: /* [] */0 + } + } + } +}, (function (x) { + return !mod2(x); +})), [ + /* [] */0, + { + hd: 2, + tl: { + hd: 2, + tl: { hd: 2, tl: { - hd: 2, - tl: { - hd: 2, - tl: { - hd: 4, - tl: /* [] */0 - } - } + hd: 4, + tl: /* [] */0 } } - ]); + } + } +]); eq("PARTITION", Belt_List.partition(/* [] */0, mod2), [ - /* [] */0, - /* [] */0 - ]); + /* [] */0, + /* [] */0 +]); eq("UNZIP", Belt_List.unzip(/* [] */0), [ - /* [] */0, - /* [] */0 - ]); + /* [] */0, + /* [] */0 +]); eq("UNZIP", Belt_List.unzip({ - hd: [ - 1, - 2 - ], - tl: /* [] */0 - }), [ - { - hd: 1, - tl: /* [] */0 - }, - { - hd: 2, - tl: /* [] */0 - } - ]); + hd: [ + 1, + 2 + ], + tl: /* [] */0 +}), [ + { + hd: 1, + tl: /* [] */0 + }, + { + hd: 2, + tl: /* [] */0 + } +]); eq("UNZIP", Belt_List.unzip({ - hd: [ - 1, - 2 - ], - tl: { - hd: [ - 3, - 4 - ], - tl: /* [] */0 - } - }), [ - { - hd: 1, - tl: { - hd: 3, - tl: /* [] */0 - } - }, - { - hd: 2, - tl: { - hd: 4, - tl: /* [] */0 - } - } - ]); + hd: [ + 1, + 2 + ], + tl: { + hd: [ + 3, + 4 + ], + tl: /* [] */0 + } +}), [ + { + hd: 1, + tl: { + hd: 3, + tl: /* [] */0 + } + }, + { + hd: 2, + tl: { + hd: 4, + tl: /* [] */0 + } + } +]); eq("FILTER", Belt_List.keep({ - hd: 1, - tl: { - hd: 2, - tl: { - hd: 3, - tl: { - hd: 4, - tl: /* [] */0 - } - } - } - }, mod2), { - hd: 2, + hd: 1, + tl: { + hd: 2, + tl: { + hd: 3, tl: { hd: 4, tl: /* [] */0 } - }); + } + } +}, mod2), { + hd: 2, + tl: { + hd: 4, + tl: /* [] */0 + } +}); eq("FILTER", Belt_List.keep({ - hd: 1, - tl: { - hd: 3, - tl: { - hd: 41, - tl: /* [] */0 - } - } - }, mod2), /* [] */0); + hd: 1, + tl: { + hd: 3, + tl: { + hd: 41, + tl: /* [] */0 + } + } +}, mod2), /* [] */0); eq("FILTER", Belt_List.keep(/* [] */0, mod2), /* [] */0); eq("FILTER", Belt_List.keep({ - hd: 2, - tl: { - hd: 2, - tl: { - hd: 2, - tl: { - hd: 4, - tl: { - hd: 6, - tl: /* [] */0 - } - } - } - } - }, mod2), { + hd: 2, + tl: { + hd: 2, + tl: { hd: 2, tl: { - hd: 2, + hd: 4, tl: { - hd: 2, - tl: { - hd: 4, - tl: { - hd: 6, - tl: /* [] */0 - } - } + hd: 6, + tl: /* [] */0 + } + } + } + } +}, mod2), { + hd: 2, + tl: { + hd: 2, + tl: { + hd: 2, + tl: { + hd: 4, + tl: { + hd: 6, + tl: /* [] */0 } } - }); + } + } +}); eq("FILTER2", Belt_List.keepWithIndex(/* [] */0, evenIndex), /* [] */0); eq("FILTER2", Belt_List.keepWithIndex({ - hd: 1, - tl: { - hd: 2, - tl: { - hd: 3, - tl: { - hd: 4, - tl: /* [] */0 - } - } - } - }, evenIndex), { - hd: 1, + hd: 1, + tl: { + hd: 2, + tl: { + hd: 3, tl: { - hd: 3, + hd: 4, tl: /* [] */0 } - }); + } + } +}, evenIndex), { + hd: 1, + tl: { + hd: 3, + tl: /* [] */0 + } +}); eq("FILTER2", Belt_List.keepWithIndex({ - hd: 0, + hd: 0, + tl: { + hd: 1, + tl: { + hd: 2, + tl: { + hd: 3, + tl: { + hd: 4, tl: { - hd: 1, + hd: 5, tl: { - hd: 2, + hd: 6, tl: { - hd: 3, - tl: { - hd: 4, - tl: { - hd: 5, - tl: { - hd: 6, - tl: { - hd: 7, - tl: /* [] */0 - } - } - } - } + hd: 7, + tl: /* [] */0 } } } - }, evenIndex), { - hd: 0, - tl: { - hd: 2, - tl: { - hd: 4, - tl: { - hd: 6, - tl: /* [] */0 - } } } - }); + } + } +}, evenIndex), { + hd: 0, + tl: { + hd: 2, + tl: { + hd: 4, + tl: { + hd: 6, + tl: /* [] */0 + } + } + } +}); function id(x) { return x; } eq("MAP", Belt_List.map(Belt_List.makeBy(5, id), (function (x) { - return (x << 1); - })), { - hd: 0, + return (x << 1); +})), { + hd: 0, + tl: { + hd: 2, + tl: { + hd: 4, tl: { - hd: 2, + hd: 6, tl: { - hd: 4, - tl: { - hd: 6, - tl: { - hd: 8, - tl: /* [] */0 - } - } + hd: 8, + tl: /* [] */0 } } - }); + } + } +}); eq("MAP", Belt_List.map(/* [] */0, id), /* [] */0); eq("MAP", Belt_List.map({ - hd: 1, - tl: /* [] */0 - }, (function (x) { - return -x | 0; - })), { - hd: -1, - tl: /* [] */0 - }); + hd: 1, + tl: /* [] */0 +}, (function (x) { + return -x | 0; +})), { + hd: -1, + tl: /* [] */0 +}); function add(a, b) { return a + b | 0; @@ -766,40 +766,40 @@ var length_10_id = Belt_List.makeBy(10, id); var length_8_id = Belt_List.makeBy(8, id); var d = Belt_List.makeBy(10, (function (x) { - return (x << 1); - })); + return (x << 1); +})); eq("MAP2", Belt_List.zipBy(length_10_id, length_10_id, add), d); eq("MAP2", Belt_List.zipBy(/* [] */0, { - hd: 1, - tl: /* [] */0 - }, add), /* [] */0); + hd: 1, + tl: /* [] */0 +}, add), /* [] */0); eq("MAP2", Belt_List.zipBy({ - hd: 1, - tl: /* [] */0 - }, /* [] */0, add), /* [] */0); + hd: 1, + tl: /* [] */0 +}, /* [] */0, add), /* [] */0); eq("MAP2", Belt_List.zipBy(/* [] */0, /* [] */0, add), /* [] */0); eq("MAP2", Belt_List.zipBy(length_10_id, length_10_id, add), Belt_List.concat(Belt_List.map(length_8_id, (function (x) { - return (x << 1); - })), { - hd: 16, - tl: { - hd: 18, - tl: /* [] */0 - } - })); + return (x << 1); +})), { + hd: 16, + tl: { + hd: 18, + tl: /* [] */0 + } +})); eq("MAP2", Belt_List.zipBy(length_10_id, length_8_id, add), Belt_List.mapWithIndex(length_8_id, (function (i, x) { - return i + x | 0; - }))); + return i + x | 0; +}))); eq("MAP2", Belt_List.reverse(Belt_List.mapReverse2(length_10_id, length_10_id, add)), Belt_List.map(length_10_id, (function (x) { - return (x << 1); - }))); + return (x << 1); +}))); var xs = Belt_List.reverse(Belt_List.mapReverse2(length_8_id, length_10_id, add)); @@ -808,70 +808,70 @@ eq("File \"bs_list_test.res\", line 163, characters 5-12", Belt_List.length(xs), eq("MAP2", xs, Belt_List.zipBy(length_10_id, length_8_id, add)); eq("MAP2", Belt_List.mapReverse2({ - hd: 1, - tl: { - hd: 2, - tl: { - hd: 3, - tl: /* [] */0 - } - } - }, { - hd: 1, - tl: { - hd: 2, - tl: /* [] */0 - } - }, (function (x, y) { - return x + y | 0; - })), { - hd: 4, - tl: { - hd: 2, - tl: /* [] */0 - } - }); + hd: 1, + tl: { + hd: 2, + tl: { + hd: 3, + tl: /* [] */0 + } + } +}, { + hd: 1, + tl: { + hd: 2, + tl: /* [] */0 + } +}, (function (x, y) { + return x + y | 0; +})), { + hd: 4, + tl: { + hd: 2, + tl: /* [] */0 + } +}); eq("TAKE", Belt_List.take({ - hd: 1, - tl: { - hd: 2, - tl: { - hd: 3, - tl: /* [] */0 - } - } - }, 2), { - hd: 1, - tl: { - hd: 2, - tl: /* [] */0 - } - }); + hd: 1, + tl: { + hd: 2, + tl: { + hd: 3, + tl: /* [] */0 + } + } +}, 2), { + hd: 1, + tl: { + hd: 2, + tl: /* [] */0 + } +}); eq("TAKE", Belt_List.take(/* [] */0, 1), undefined); eq("TAKE", Belt_List.take({ - hd: 1, - tl: { - hd: 2, - tl: /* [] */0 - } - }, 3), undefined); + hd: 1, + tl: { + hd: 2, + tl: /* [] */0 + } +}, 3), undefined); eq("TAKE", Belt_List.take({ - hd: 1, - tl: { - hd: 2, - tl: /* [] */0 - } - }, 2), { - hd: 1, - tl: { - hd: 2, - tl: /* [] */0 - } - }); + hd: 1, + tl: { + hd: 2, + tl: /* [] */0 + } +}, 2), { + hd: 1, + tl: { + hd: 2, + tl: /* [] */0 + } +}); eq("TAKE", Belt_List.take(length_10_id, 8), length_8_id); @@ -882,12 +882,12 @@ eq("TAKE", Belt_List.take(length_8_id, -2), undefined); eq("DROP", Belt_List.drop(length_10_id, 10), /* [] */0); eq("DROP", Belt_List.drop(length_10_id, 8), { - hd: 8, - tl: { - hd: 9, - tl: /* [] */0 - } - }); + hd: 8, + tl: { + hd: 9, + tl: /* [] */0 + } +}); eq("DROP", Belt_List.drop(length_10_id, 0), length_10_id); @@ -900,94 +900,94 @@ eq("SPLIT", Belt_List.splitAt(/* [] */0, 1), undefined); eq("SPLIT", Belt_List.splitAt(a, 6), undefined); eq("SPLIT", Belt_List.splitAt(a, 5), [ - a, - /* [] */0 - ]); + a, + /* [] */0 +]); eq("SPLIT", Belt_List.splitAt(a, 4), [ - { - hd: 0, + { + hd: 0, + tl: { + hd: 1, + tl: { + hd: 2, tl: { - hd: 1, - tl: { - hd: 2, - tl: { - hd: 3, - tl: /* [] */0 - } - } + hd: 3, + tl: /* [] */0 } - }, - { - hd: 4, - tl: /* [] */0 } - ]); + } + }, + { + hd: 4, + tl: /* [] */0 + } +]); eq("SPLIT", Belt_List.splitAt(a, 3), [ - { - hd: 0, - tl: { - hd: 1, - tl: { - hd: 2, - tl: /* [] */0 - } - } - }, - { - hd: 3, - tl: { - hd: 4, - tl: /* [] */0 - } + { + hd: 0, + tl: { + hd: 1, + tl: { + hd: 2, + tl: /* [] */0 } - ]); + } + }, + { + hd: 3, + tl: { + hd: 4, + tl: /* [] */0 + } + } +]); eq("SPLIT", Belt_List.splitAt(a, 2), [ - { - hd: 0, - tl: { - hd: 1, - tl: /* [] */0 - } - }, - { - hd: 2, - tl: { - hd: 3, - tl: { - hd: 4, - tl: /* [] */0 - } - } + { + hd: 0, + tl: { + hd: 1, + tl: /* [] */0 + } + }, + { + hd: 2, + tl: { + hd: 3, + tl: { + hd: 4, + tl: /* [] */0 } - ]); + } + } +]); eq("SPLIT", Belt_List.splitAt(a, 1), [ - { - hd: 0, - tl: /* [] */0 - }, - { - hd: 1, + { + hd: 0, + tl: /* [] */0 + }, + { + hd: 1, + tl: { + hd: 2, + tl: { + hd: 3, tl: { - hd: 2, - tl: { - hd: 3, - tl: { - hd: 4, - tl: /* [] */0 - } - } + hd: 4, + tl: /* [] */0 } } - ]); + } + } +]); eq("SPLIT", Belt_List.splitAt(a, 0), [ - /* [] */0, - a - ]); + /* [] */0, + a +]); eq("SPLIT", Belt_List.splitAt(a, -1), undefined); @@ -1000,312 +1000,246 @@ function eqx(x, y) { } b("File \"bs_list_test.res\", line 205, characters 4-11", Belt_List.hasAssoc({ - hd: [ - 1, - "1" - ], - tl: { - hd: [ - 2, - "2" - ], - tl: { - hd: [ - 3, - "3" - ], - tl: /* [] */0 - } - } - }, 2, (function (prim0, prim1) { - return prim0 === prim1; - }))); + hd: [ + 1, + "1" + ], + tl: { + hd: [ + 2, + "2" + ], + tl: { + hd: [ + 3, + "3" + ], + tl: /* [] */0 + } + } +}, 2, (function (prim0, prim1) { + return prim0 === prim1; +}))); b("File \"bs_list_test.res\", line 206, characters 4-11", !Belt_List.hasAssoc({ - hd: [ - 1, - "1" - ], - tl: { - hd: [ - 2, - "2" - ], - tl: { - hd: [ - 3, - "3" - ], - tl: /* [] */0 - } - } - }, 4, (function (prim0, prim1) { - return prim0 === prim1; - }))); - -b("File \"bs_list_test.res\", line 207, characters 4-11", Belt_List.hasAssoc({ - hd: [ - 1, - "1" - ], - tl: { - hd: [ - 2, - "2" - ], - tl: { - hd: [ - 3, - "3" - ], - tl: /* [] */0 - } - } - }, 4, (function (x, y) { - return (x + 1 | 0) === y; - }))); - -eq("REMOVEASSOQ", Belt_List.removeAssoc({ - hd: [ - 1, - "1" - ], - tl: { - hd: [ - 2, - "2" - ], - tl: { - hd: [ - 3, - "3" - ], - tl: /* [] */0 - } - } - }, 3, (function (prim0, prim1) { - return prim0 === prim1; - })), { + hd: [ + 1, + "1" + ], + tl: { + hd: [ + 2, + "2" + ], + tl: { hd: [ - 1, - "1" + 3, + "3" ], - tl: { - hd: [ - 2, - "2" - ], - tl: /* [] */0 - } - }); + tl: /* [] */0 + } + } +}, 4, (function (prim0, prim1) { + return prim0 === prim1; +}))); -eq("REMOVEASSOQ", Belt_List.removeAssoc({ - hd: [ - 1, - "1" - ], - tl: { - hd: [ - 2, - "2" - ], - tl: { - hd: [ - 3, - "3" - ], - tl: /* [] */0 - } - } - }, 1, (function (prim0, prim1) { - return prim0 === prim1; - })), { +b("File \"bs_list_test.res\", line 207, characters 4-11", Belt_List.hasAssoc({ + hd: [ + 1, + "1" + ], + tl: { + hd: [ + 2, + "2" + ], + tl: { hd: [ - 2, - "2" + 3, + "3" ], - tl: { - hd: [ - 3, - "3" - ], - tl: /* [] */0 - } - }); + tl: /* [] */0 + } + } +}, 4, (function (x, y) { + return (x + 1 | 0) === y; +}))); eq("REMOVEASSOQ", Belt_List.removeAssoc({ - hd: [ - 1, - "1" - ], - tl: { - hd: [ - 2, - "2" - ], - tl: { - hd: [ - 3, - "3" - ], - tl: /* [] */0 - } - } - }, 2, (function (prim0, prim1) { - return prim0 === prim1; - })), { + hd: [ + 1, + "1" + ], + tl: { + hd: [ + 2, + "2" + ], + tl: { hd: [ - 1, - "1" + 3, + "3" ], - tl: { - hd: [ - 3, - "3" - ], - tl: /* [] */0 - } - }); + tl: /* [] */0 + } + } +}, 3, (function (prim0, prim1) { + return prim0 === prim1; +})), { + hd: [ + 1, + "1" + ], + tl: { + hd: [ + 2, + "2" + ], + tl: /* [] */0 + } +}); eq("REMOVEASSOQ", Belt_List.removeAssoc({ - hd: [ - 1, - "1" - ], - tl: { - hd: [ - 2, - "2" - ], - tl: { - hd: [ - 3, - "3" - ], - tl: /* [] */0 - } - } - }, 0, (function (prim0, prim1) { - return prim0 === prim1; - })), { + hd: [ + 1, + "1" + ], + tl: { + hd: [ + 2, + "2" + ], + tl: { hd: [ - 1, - "1" + 3, + "3" ], - tl: { - hd: [ - 2, - "2" - ], - tl: { - hd: [ - 3, - "3" - ], - tl: /* [] */0 - } - } - }); + tl: /* [] */0 + } + } +}, 1, (function (prim0, prim1) { + return prim0 === prim1; +})), { + hd: [ + 2, + "2" + ], + tl: { + hd: [ + 3, + "3" + ], + tl: /* [] */0 + } +}); eq("REMOVEASSOQ", Belt_List.removeAssoc({ - hd: [ - 1, - "1" - ], - tl: { - hd: [ - 2, - "2" - ], - tl: { - hd: [ - 3, - "3" - ], - tl: /* [] */0 - } - } - }, 3, eqx), { + hd: [ + 1, + "1" + ], + tl: { + hd: [ + 2, + "2" + ], + tl: { hd: [ - 1, - "1" + 3, + "3" ], - tl: { - hd: [ - 2, - "2" - ], - tl: /* [] */0 - } - }); + tl: /* [] */0 + } + } +}, 2, (function (prim0, prim1) { + return prim0 === prim1; +})), { + hd: [ + 1, + "1" + ], + tl: { + hd: [ + 3, + "3" + ], + tl: /* [] */0 + } +}); eq("REMOVEASSOQ", Belt_List.removeAssoc({ - hd: [ - 1, - "1" - ], - tl: { - hd: [ - 2, - "2" - ], - tl: { - hd: [ - 3, - "3" - ], - tl: /* [] */0 - } - } - }, 1, eqx), { + hd: [ + 1, + "1" + ], + tl: { + hd: [ + 2, + "2" + ], + tl: { hd: [ - 2, - "2" + 3, + "3" ], - tl: { - hd: [ - 3, - "3" - ], - tl: /* [] */0 - } - }); + tl: /* [] */0 + } + } +}, 0, (function (prim0, prim1) { + return prim0 === prim1; +})), { + hd: [ + 1, + "1" + ], + tl: { + hd: [ + 2, + "2" + ], + tl: { + hd: [ + 3, + "3" + ], + tl: /* [] */0 + } + } +}); eq("REMOVEASSOQ", Belt_List.removeAssoc({ - hd: [ - 1, - "1" - ], - tl: { - hd: [ - 2, - "2" - ], - tl: { - hd: [ - 3, - "3" - ], - tl: /* [] */0 - } - } - }, 2, eqx), { + hd: [ + 1, + "1" + ], + tl: { + hd: [ + 2, + "2" + ], + tl: { hd: [ - 1, - "1" + 3, + "3" ], - tl: { - hd: [ - 3, - "3" - ], - tl: /* [] */0 - } - }); - -eq("REMOVEASSOQ", Belt_List.removeAssoc(/* [] */0, 2, eqx), /* [] */0); + tl: /* [] */0 + } + } +}, 3, eqx), { + hd: [ + 1, + "1" + ], + tl: { + hd: [ + 2, + "2" + ], + tl: /* [] */0 + } +}); -var ll = { +eq("REMOVEASSOQ", Belt_List.removeAssoc({ hd: [ 1, "1" @@ -1323,305 +1257,371 @@ var ll = { tl: /* [] */0 } } -}; - -var ll0 = Belt_List.removeAssoc(ll, 0, eqx); - -b("File \"bs_list_test.res\", line 222, characters 4-11", ll === ll0); - -var ll1 = Belt_List.setAssoc(ll, 2, "22", (function (prim0, prim1) { - return prim0 === prim1; - })); +}, 1, eqx), { + hd: [ + 2, + "2" + ], + tl: { + hd: [ + 3, + "3" + ], + tl: /* [] */0 + } +}); -eq("File \"bs_list_test.res\", line 224, characters 5-12", ll1, { +eq("REMOVEASSOQ", Belt_List.removeAssoc({ + hd: [ + 1, + "1" + ], + tl: { + hd: [ + 2, + "2" + ], + tl: { hd: [ - 1, - "1" + 3, + "3" ], - tl: { - hd: [ - 2, - "22" - ], - tl: { - hd: [ - 3, - "3" - ], - tl: /* [] */0 - } - } - }); + tl: /* [] */0 + } + } +}, 2, eqx), { + hd: [ + 1, + "1" + ], + tl: { + hd: [ + 3, + "3" + ], + tl: /* [] */0 + } +}); + +eq("REMOVEASSOQ", Belt_List.removeAssoc(/* [] */0, 2, eqx), /* [] */0); + +var ll = { + hd: [ + 1, + "1" + ], + tl: { + hd: [ + 2, + "2" + ], + tl: { + hd: [ + 3, + "3" + ], + tl: /* [] */0 + } + } +}; + +var ll0 = Belt_List.removeAssoc(ll, 0, eqx); + +b("File \"bs_list_test.res\", line 222, characters 4-11", ll === ll0); + +var ll1 = Belt_List.setAssoc(ll, 2, "22", (function (prim0, prim1) { + return prim0 === prim1; +})); + +eq("File \"bs_list_test.res\", line 224, characters 5-12", ll1, { + hd: [ + 1, + "1" + ], + tl: { + hd: [ + 2, + "22" + ], + tl: { + hd: [ + 3, + "3" + ], + tl: /* [] */0 + } + } +}); var ll2 = Belt_List.setAssoc(ll1, 22, "2", (function (prim0, prim1) { - return prim0 === prim1; - })); + return prim0 === prim1; +})); b("File \"bs_list_test.res\", line 226, characters 4-11", Caml_obj.equal(ll2, { - hd: [ - 22, - "2" - ], - tl: ll1 - })); + hd: [ + 22, + "2" + ], + tl: ll1 +})); b("File \"bs_list_test.res\", line 227, characters 4-11", Belt_List.tailExn(ll2) === ll1); b("File \"bs_list_test.res\", line 229, characters 4-11", Caml_obj.equal(Belt_List.setAssoc({ - hd: [ - 1, - "a" - ], - tl: { - hd: [ - 2, - "b" - ], - tl: { - hd: [ - 3, - "c" - ], - tl: /* [] */0 - } - } - }, 2, "x", (function (prim0, prim1) { - return prim0 === prim1; - })), { - hd: [ - 1, - "a" - ], - tl: { - hd: [ - 2, - "x" - ], - tl: { - hd: [ - 3, - "c" - ], - tl: /* [] */0 - } - } - })); + hd: [ + 1, + "a" + ], + tl: { + hd: [ + 2, + "b" + ], + tl: { + hd: [ + 3, + "c" + ], + tl: /* [] */0 + } + } +}, 2, "x", (function (prim0, prim1) { + return prim0 === prim1; +})), { + hd: [ + 1, + "a" + ], + tl: { + hd: [ + 2, + "x" + ], + tl: { + hd: [ + 3, + "c" + ], + tl: /* [] */0 + } + } +})); b("File \"bs_list_test.res\", line 234, characters 4-11", Caml_obj.equal(Belt_List.setAssoc({ - hd: [ - 1, - "a" - ], - tl: { - hd: [ - 3, - "c" - ], - tl: /* [] */0 - } - }, 2, "2", (function (prim0, prim1) { - return prim0 === prim1; - })), { - hd: [ - 2, - "2" - ], - tl: { - hd: [ - 1, - "a" - ], - tl: { - hd: [ - 3, - "c" - ], - tl: /* [] */0 - } - } - })); - -eq("File \"bs_list_test.res\", line 237, characters 5-12", Belt_List.setAssoc(/* [] */0, 1, "1", (function (prim0, prim1) { - return prim0 === prim1; - })), { + hd: [ + 1, + "a" + ], + tl: { + hd: [ + 3, + "c" + ], + tl: /* [] */0 + } +}, 2, "2", (function (prim0, prim1) { + return prim0 === prim1; +})), { + hd: [ + 2, + "2" + ], + tl: { + hd: [ + 1, + "a" + ], + tl: { hd: [ - 1, - "1" + 3, + "c" ], tl: /* [] */0 - }); + } + } +})); + +eq("File \"bs_list_test.res\", line 237, characters 5-12", Belt_List.setAssoc(/* [] */0, 1, "1", (function (prim0, prim1) { + return prim0 === prim1; +})), { + hd: [ + 1, + "1" + ], + tl: /* [] */0 +}); debugger; eq("File \"bs_list_test.res\", line 239, characters 5-12", Belt_List.setAssoc({ - hd: [ - 1, - "2" - ], - tl: /* [] */0 - }, 1, "1", (function (prim0, prim1) { - return prim0 === prim1; - })), { - hd: [ - 1, - "1" - ], - tl: /* [] */0 - }); + hd: [ + 1, + "2" + ], + tl: /* [] */0 +}, 1, "1", (function (prim0, prim1) { + return prim0 === prim1; +})), { + hd: [ + 1, + "1" + ], + tl: /* [] */0 +}); eq("File \"bs_list_test.res\", line 241, characters 5-12", Belt_List.setAssoc({ - hd: [ - 0, - "0" - ], - tl: { - hd: [ - 1, - "2" - ], - tl: /* [] */0 - } - }, 1, "1", (function (prim0, prim1) { - return prim0 === prim1; - })), { - hd: [ - 0, - "0" - ], - tl: { - hd: [ - 1, - "1" - ], - tl: /* [] */0 - } - }); + hd: [ + 0, + "0" + ], + tl: { + hd: [ + 1, + "2" + ], + tl: /* [] */0 + } +}, 1, "1", (function (prim0, prim1) { + return prim0 === prim1; +})), { + hd: [ + 0, + "0" + ], + tl: { + hd: [ + 1, + "1" + ], + tl: /* [] */0 + } +}); b("File \"bs_list_test.res\", line 242, characters 4-11", Caml_obj.equal(Belt_List.getAssoc({ - hd: [ - 1, - "a" - ], - tl: { - hd: [ - 2, - "b" - ], - tl: { - hd: [ - 3, - "c" - ], - tl: /* [] */0 - } - } - }, 2, (function (prim0, prim1) { - return prim0 === prim1; - })), "b")); + hd: [ + 1, + "a" + ], + tl: { + hd: [ + 2, + "b" + ], + tl: { + hd: [ + 3, + "c" + ], + tl: /* [] */0 + } + } +}, 2, (function (prim0, prim1) { + return prim0 === prim1; +})), "b")); b("File \"bs_list_test.res\", line 243, characters 4-11", Belt_List.getAssoc({ - hd: [ - 1, - "a" - ], - tl: { - hd: [ - 2, - "b" - ], - tl: { - hd: [ - 3, - "c" - ], - tl: /* [] */0 - } - } - }, 4, (function (prim0, prim1) { - return prim0 === prim1; - })) === undefined); + hd: [ + 1, + "a" + ], + tl: { + hd: [ + 2, + "b" + ], + tl: { + hd: [ + 3, + "c" + ], + tl: /* [] */0 + } + } +}, 4, (function (prim0, prim1) { + return prim0 === prim1; +})) === undefined); eq("File \"bs_list_test.res\", line 248, characters 4-11", [ - Belt_List.head(length_10_id), - Belt_List.tail(length_10_id) - ], [ - 0, - Belt_List.drop(length_10_id, 1) - ]); + Belt_List.head(length_10_id), + Belt_List.tail(length_10_id) +], [ + 0, + Belt_List.drop(length_10_id, 1) +]); eq("File \"bs_list_test.res\", line 255, characters 5-12", Belt_List.head(/* [] */0), undefined); $$throw("File \"bs_list_test.res\", line 256, characters 8-15", (function (param) { - Belt_List.headExn(/* [] */0); - })); + Belt_List.headExn(/* [] */0); +})); $$throw("File \"bs_list_test.res\", line 257, characters 8-15", (function (param) { - Belt_List.tailExn(/* [] */0); - })); + Belt_List.tailExn(/* [] */0); +})); $$throw("File \"bs_list_test.res\", line 258, characters 8-15", (function (param) { - Belt_List.getExn({ - hd: 0, - tl: { - hd: 1, - tl: /* [] */0 - } - }, -1); - })); + Belt_List.getExn({ + hd: 0, + tl: { + hd: 1, + tl: /* [] */0 + } + }, -1); +})); $$throw("File \"bs_list_test.res\", line 259, characters 8-15", (function (param) { - Belt_List.getExn({ - hd: 0, - tl: { - hd: 1, - tl: /* [] */0 - } - }, 2); - })); + Belt_List.getExn({ + hd: 0, + tl: { + hd: 1, + tl: /* [] */0 + } + }, 2); +})); eq("File \"bs_list_test.res\", line 260, characters 5-12", Belt_List.map({ - hd: 0, - tl: { - hd: 1, - tl: /* [] */0 - } - }, (function (i) { - return Belt_List.getExn({ - hd: 0, - tl: { - hd: 1, - tl: /* [] */0 - } - }, i); - })), { - hd: 0, - tl: { - hd: 1, - tl: /* [] */0 - } - }); + hd: 0, + tl: { + hd: 1, + tl: /* [] */0 + } +}, (function (i) { + return Belt_List.getExn({ + hd: 0, + tl: { + hd: 1, + tl: /* [] */0 + } + }, i); +})), { + hd: 0, + tl: { + hd: 1, + tl: /* [] */0 + } +}); eq("File \"bs_list_test.res\", line 261, characters 5-12", Belt_List.headExn({ - hd: 1, - tl: /* [] */0 - }), 1); + hd: 1, + tl: /* [] */0 +}), 1); eq("File \"bs_list_test.res\", line 262, characters 5-12", Belt_List.tailExn({ - hd: 1, - tl: /* [] */0 - }), /* [] */0); + hd: 1, + tl: /* [] */0 +}), /* [] */0); Belt_List.forEachWithIndex(length_10_id, (function (i, x) { - eq("File \"bs_list_test.res\", line 263, characters 48-55", Belt_List.get(length_10_id, i), x); - })); + eq("File \"bs_list_test.res\", line 263, characters 48-55", Belt_List.get(length_10_id, i), x); +})); eq("File \"bs_list_test.res\", line 264, characters 5-12", Belt_List.tail(/* [] */0), undefined); eq("File \"bs_list_test.res\", line 265, characters 5-12", Belt_List.drop(/* [] */0, 3), undefined); eq("File \"bs_list_test.res\", line 266, characters 5-12", Belt_List.mapWithIndex(/* [] */0, (function (i, x) { - return i + x | 0; - })), /* [] */0); + return i + x | 0; +})), /* [] */0); eq("File \"bs_list_test.res\", line 267, characters 5-12", Belt_List.get(length_10_id, -1), undefined); @@ -1646,10 +1646,10 @@ eq("File \"bs_list_test.res\", line 290, characters 5-12", Belt_List.reduce(leng eq("File \"bs_list_test.res\", line 291, characters 5-12", Belt_List.reduceReverse(length_10_id, 0, add), 45); eq("File \"bs_list_test.res\", line 292, characters 5-12", Belt_List.reduceReverse(Belt_List.makeBy(10000, (function (i) { - return i; - })), 0, (function (prim0, prim1) { - return prim0 + prim1 | 0; - })), 49995000); + return i; +})), 0, (function (prim0, prim1) { + return prim0 + prim1 | 0; +})), 49995000); eq("File \"bs_list_test.res\", line 295, characters 5-12", sum2(length_10_id, length_10_id), 90); @@ -1658,633 +1658,633 @@ eq("File \"bs_list_test.res\", line 296, characters 5-12", sum2(length_8_id, len eq("File \"bs_list_test.res\", line 297, characters 5-12", sum2(length_10_id, length_8_id), 56); eq("File \"bs_list_test.res\", line 298, characters 5-12", Belt_List.reduce2(length_10_id, length_8_id, 0, (function (acc, x, y) { - return (acc + x | 0) + y | 0; - })), 56); + return (acc + x | 0) + y | 0; +})), 56); eq("File \"bs_list_test.res\", line 299, characters 5-12", Belt_List.reduce2({ - hd: 1, - tl: { - hd: 2, - tl: { - hd: 3, - tl: /* [] */0 - } - } - }, { - hd: 2, - tl: { - hd: 4, - tl: { - hd: 6, - tl: /* [] */0 - } - } - }, 0, (function (a, b, c) { - return (a + b | 0) + c | 0; - })), 18); + hd: 1, + tl: { + hd: 2, + tl: { + hd: 3, + tl: /* [] */0 + } + } +}, { + hd: 2, + tl: { + hd: 4, + tl: { + hd: 6, + tl: /* [] */0 + } + } +}, 0, (function (a, b, c) { + return (a + b | 0) + c | 0; +})), 18); eq("File \"bs_list_test.res\", line 300, characters 5-12", Belt_List.reduceReverse2(length_10_id, length_8_id, 0, (function (acc, x, y) { - return (acc + x | 0) + y | 0; - })), 56); + return (acc + x | 0) + y | 0; +})), 56); eq("File \"bs_list_test.res\", line 301, characters 5-12", Belt_List.reduceReverse2(length_10_id, length_10_id, 0, (function (acc, x, y) { - return (acc + x | 0) + y | 0; - })), 90); + return (acc + x | 0) + y | 0; +})), 90); eq("File \"bs_list_test.res\", line 302, characters 5-12", Belt_List.reduceReverse2({ - hd: 1, - tl: { - hd: 2, - tl: { - hd: 3, - tl: /* [] */0 - } - } - }, { - hd: 1, - tl: { - hd: 2, - tl: /* [] */0 - } - }, 0, (function (acc, x, y) { - return (acc + x | 0) + y | 0; - })), 6); + hd: 1, + tl: { + hd: 2, + tl: { + hd: 3, + tl: /* [] */0 + } + } +}, { + hd: 1, + tl: { + hd: 2, + tl: /* [] */0 + } +}, 0, (function (acc, x, y) { + return (acc + x | 0) + y | 0; +})), 6); eq("File \"bs_list_test.res\", line 303, characters 5-12", Belt_List.every({ - hd: 2, - tl: { - hd: 4, - tl: { - hd: 6, - tl: /* [] */0 - } - } - }, mod2), true); + hd: 2, + tl: { + hd: 4, + tl: { + hd: 6, + tl: /* [] */0 + } + } +}, mod2), true); eq("File \"bs_list_test.res\", line 304, characters 5-12", Belt_List.every({ - hd: 1, - tl: /* [] */0 - }, mod2), false); + hd: 1, + tl: /* [] */0 +}, mod2), false); eq("File \"bs_list_test.res\", line 305, characters 5-12", Belt_List.every(/* [] */0, mod2), true); eq("File \"bs_list_test.res\", line 306, characters 5-12", Belt_List.some({ - hd: 1, - tl: { - hd: 2, - tl: { - hd: 5, - tl: /* [] */0 - } - } - }, mod2), true); + hd: 1, + tl: { + hd: 2, + tl: { + hd: 5, + tl: /* [] */0 + } + } +}, mod2), true); eq("File \"bs_list_test.res\", line 307, characters 5-12", Belt_List.some({ - hd: 1, - tl: { - hd: 3, - tl: { - hd: 5, - tl: /* [] */0 - } - } - }, mod2), false); + hd: 1, + tl: { + hd: 3, + tl: { + hd: 5, + tl: /* [] */0 + } + } +}, mod2), false); eq("File \"bs_list_test.res\", line 308, characters 5-12", Belt_List.some(/* [] */0, mod2), false); eq("File \"bs_list_test.res\", line 309, characters 5-12", Belt_List.has({ - hd: 1, - tl: { - hd: 2, - tl: { - hd: 3, - tl: /* [] */0 - } - } - }, "2", (function (x, s) { - return String(x) === s; - })), true); + hd: 1, + tl: { + hd: 2, + tl: { + hd: 3, + tl: /* [] */0 + } + } +}, "2", (function (x, s) { + return String(x) === s; +})), true); eq("File \"bs_list_test.res\", line 310, characters 5-12", Belt_List.has({ - hd: 1, - tl: { - hd: 2, - tl: { - hd: 3, - tl: /* [] */0 - } - } - }, "0", (function (x, s) { - return String(x) === s; - })), false); + hd: 1, + tl: { + hd: 2, + tl: { + hd: 3, + tl: /* [] */0 + } + } +}, "0", (function (x, s) { + return String(x) === s; +})), false); b("File \"bs_list_test.res\", line 312, characters 4-11", Belt_List.reduceReverse({ - hd: 1, - tl: { - hd: 2, - tl: { - hd: 3, - tl: { - hd: 4, - tl: /* [] */0 - } - } - } - }, 0, (function (prim0, prim1) { - return prim0 + prim1 | 0; - })) === 10); + hd: 1, + tl: { + hd: 2, + tl: { + hd: 3, + tl: { + hd: 4, + tl: /* [] */0 + } + } + } +}, 0, (function (prim0, prim1) { + return prim0 + prim1 | 0; +})) === 10); b("File \"bs_list_test.res\", line 313, characters 4-11", Belt_List.reduceReverse({ - hd: 1, - tl: { - hd: 2, - tl: { - hd: 3, - tl: { - hd: 4, - tl: /* [] */0 - } - } - } - }, 10, (function (prim0, prim1) { - return prim0 - prim1 | 0; - })) === 0); + hd: 1, + tl: { + hd: 2, + tl: { + hd: 3, + tl: { + hd: 4, + tl: /* [] */0 + } + } + } +}, 10, (function (prim0, prim1) { + return prim0 - prim1 | 0; +})) === 0); b("File \"bs_list_test.res\", line 314, characters 4-11", Caml_obj.equal(Belt_List.reduceReverse({ - hd: 1, - tl: { - hd: 2, - tl: { - hd: 3, - tl: { - hd: 4, - tl: /* [] */0 - } - } - } - }, /* [] */0, Belt_List.add), { - hd: 1, - tl: { - hd: 2, - tl: { - hd: 3, - tl: { - hd: 4, - tl: /* [] */0 - } - } - } - })); + hd: 1, + tl: { + hd: 2, + tl: { + hd: 3, + tl: { + hd: 4, + tl: /* [] */0 + } + } + } +}, /* [] */0, Belt_List.add), { + hd: 1, + tl: { + hd: 2, + tl: { + hd: 3, + tl: { + hd: 4, + tl: /* [] */0 + } + } + } +})); b("File \"bs_list_test.res\", line 315, characters 4-11", Belt_List.reduce({ - hd: 1, - tl: { - hd: 2, - tl: { - hd: 3, - tl: { - hd: 4, - tl: /* [] */0 - } - } - } - }, 0, (function (prim0, prim1) { - return prim0 + prim1 | 0; - })) === 10); + hd: 1, + tl: { + hd: 2, + tl: { + hd: 3, + tl: { + hd: 4, + tl: /* [] */0 + } + } + } +}, 0, (function (prim0, prim1) { + return prim0 + prim1 | 0; +})) === 10); b("File \"bs_list_test.res\", line 316, characters 4-11", Belt_List.reduce({ - hd: 1, - tl: { - hd: 2, - tl: { - hd: 3, - tl: { - hd: 4, - tl: /* [] */0 - } - } - } - }, 10, (function (prim0, prim1) { - return prim0 - prim1 | 0; - })) === 0); + hd: 1, + tl: { + hd: 2, + tl: { + hd: 3, + tl: { + hd: 4, + tl: /* [] */0 + } + } + } +}, 10, (function (prim0, prim1) { + return prim0 - prim1 | 0; +})) === 0); b("File \"bs_list_test.res\", line 317, characters 4-11", Caml_obj.equal(Belt_List.reduce({ - hd: 1, - tl: { - hd: 2, - tl: { - hd: 3, - tl: { - hd: 4, - tl: /* [] */0 - } - } - } - }, /* [] */0, Belt_List.add), { - hd: 4, - tl: { - hd: 3, - tl: { - hd: 2, - tl: { - hd: 1, - tl: /* [] */0 - } - } - } - })); + hd: 1, + tl: { + hd: 2, + tl: { + hd: 3, + tl: { + hd: 4, + tl: /* [] */0 + } + } + } +}, /* [] */0, Belt_List.add), { + hd: 4, + tl: { + hd: 3, + tl: { + hd: 2, + tl: { + hd: 1, + tl: /* [] */0 + } + } + } +})); b("File \"bs_list_test.res\", line 318, characters 4-11", Belt_List.reduceWithIndex({ - hd: 1, - tl: { - hd: 2, - tl: { - hd: 3, - tl: { - hd: 4, - tl: /* [] */0 - } - } - } - }, 0, (function (acc, x, i) { - return (acc + x | 0) + i | 0; - })) === 16); + hd: 1, + tl: { + hd: 2, + tl: { + hd: 3, + tl: { + hd: 4, + tl: /* [] */0 + } + } + } +}, 0, (function (acc, x, i) { + return (acc + x | 0) + i | 0; +})) === 16); b("File \"bs_list_test.res\", line 319, characters 4-11", Belt_List.reduceReverse2({ - hd: 1, - tl: { - hd: 2, - tl: { - hd: 3, - tl: /* [] */0 - } - } - }, { - hd: 1, - tl: { - hd: 2, - tl: /* [] */0 - } - }, 0, (function (acc, x, y) { - return (acc + x | 0) + y | 0; - })) === 6); + hd: 1, + tl: { + hd: 2, + tl: { + hd: 3, + tl: /* [] */0 + } + } +}, { + hd: 1, + tl: { + hd: 2, + tl: /* [] */0 + } +}, 0, (function (acc, x, y) { + return (acc + x | 0) + y | 0; +})) === 6); var a$1 = Belt_List.makeBy(10000, (function (i) { - return i; - })); + return i; +})); b("File \"bs_list_test.res\", line 322, characters 4-11", Belt_List.reduceReverse2(a$1, { - hd: 0, - tl: a$1 - }, 0, (function (acc, x, y) { - return (acc + x | 0) + y | 0; - })) === 99980001); + hd: 0, + tl: a$1 +}, 0, (function (acc, x, y) { + return (acc + x | 0) + y | 0; +})) === 99980001); eq("File \"bs_list_test.res\", line 328, characters 5-12", Belt_List.every2(/* [] */0, { - hd: 1, - tl: /* [] */0 - }, (function (x, y) { - return x > y; - })), true); + hd: 1, + tl: /* [] */0 +}, (function (x, y) { + return x > y; +})), true); eq("File \"bs_list_test.res\", line 329, characters 5-12", Belt_List.every2({ - hd: 2, - tl: { - hd: 3, - tl: /* [] */0 - } - }, { - hd: 1, - tl: /* [] */0 - }, (function (x, y) { - return x > y; - })), true); + hd: 2, + tl: { + hd: 3, + tl: /* [] */0 + } +}, { + hd: 1, + tl: /* [] */0 +}, (function (x, y) { + return x > y; +})), true); eq("File \"bs_list_test.res\", line 330, characters 5-12", Belt_List.every2({ - hd: 2, - tl: /* [] */0 - }, { - hd: 1, - tl: /* [] */0 - }, (function (x, y) { - return x > y; - })), true); + hd: 2, + tl: /* [] */0 +}, { + hd: 1, + tl: /* [] */0 +}, (function (x, y) { + return x > y; +})), true); eq("File \"bs_list_test.res\", line 331, characters 5-12", Belt_List.every2({ - hd: 2, - tl: { - hd: 3, - tl: /* [] */0 - } - }, { - hd: 1, - tl: { - hd: 4, - tl: /* [] */0 - } - }, (function (x, y) { - return x > y; - })), false); + hd: 2, + tl: { + hd: 3, + tl: /* [] */0 + } +}, { + hd: 1, + tl: { + hd: 4, + tl: /* [] */0 + } +}, (function (x, y) { + return x > y; +})), false); eq("File \"bs_list_test.res\", line 332, characters 5-12", Belt_List.every2({ - hd: 2, - tl: { - hd: 3, - tl: /* [] */0 - } - }, { - hd: 1, - tl: { - hd: 0, - tl: /* [] */0 - } - }, (function (x, y) { - return x > y; - })), true); + hd: 2, + tl: { + hd: 3, + tl: /* [] */0 + } +}, { + hd: 1, + tl: { + hd: 0, + tl: /* [] */0 + } +}, (function (x, y) { + return x > y; +})), true); eq("File \"bs_list_test.res\", line 333, characters 5-12", Belt_List.some2(/* [] */0, { - hd: 1, - tl: /* [] */0 - }, (function (x, y) { - return x > y; - })), false); + hd: 1, + tl: /* [] */0 +}, (function (x, y) { + return x > y; +})), false); eq("File \"bs_list_test.res\", line 334, characters 5-12", Belt_List.some2({ - hd: 2, - tl: { - hd: 3, - tl: /* [] */0 - } - }, { - hd: 1, - tl: /* [] */0 - }, (function (x, y) { - return x > y; - })), true); + hd: 2, + tl: { + hd: 3, + tl: /* [] */0 + } +}, { + hd: 1, + tl: /* [] */0 +}, (function (x, y) { + return x > y; +})), true); eq("File \"bs_list_test.res\", line 335, characters 5-12", Belt_List.some2({ - hd: 2, - tl: { - hd: 3, - tl: /* [] */0 - } - }, { - hd: 1, - tl: { - hd: 4, - tl: /* [] */0 - } - }, (function (x, y) { - return x > y; - })), true); + hd: 2, + tl: { + hd: 3, + tl: /* [] */0 + } +}, { + hd: 1, + tl: { + hd: 4, + tl: /* [] */0 + } +}, (function (x, y) { + return x > y; +})), true); eq("File \"bs_list_test.res\", line 336, characters 5-12", Belt_List.some2({ - hd: 0, - tl: { - hd: 3, - tl: /* [] */0 - } - }, { - hd: 1, - tl: { - hd: 4, - tl: /* [] */0 - } - }, (function (x, y) { - return x > y; - })), false); + hd: 0, + tl: { + hd: 3, + tl: /* [] */0 + } +}, { + hd: 1, + tl: { + hd: 4, + tl: /* [] */0 + } +}, (function (x, y) { + return x > y; +})), false); eq("File \"bs_list_test.res\", line 337, characters 5-12", Belt_List.some2({ - hd: 0, - tl: { - hd: 3, - tl: /* [] */0 - } - }, { - hd: 3, - tl: { - hd: 2, - tl: /* [] */0 - } - }, (function (x, y) { - return x > y; - })), true); + hd: 0, + tl: { + hd: 3, + tl: /* [] */0 + } +}, { + hd: 3, + tl: { + hd: 2, + tl: /* [] */0 + } +}, (function (x, y) { + return x > y; +})), true); eq("File \"bs_list_test.res\", line 338, characters 5-12", Belt_List.some2({ - hd: 1, - tl: { - hd: 2, - tl: { - hd: 3, - tl: /* [] */0 - } - } - }, { - hd: -1, - tl: { - hd: -2, - tl: /* [] */0 - } - }, (function (x, y) { - return x === y; - })), false); + hd: 1, + tl: { + hd: 2, + tl: { + hd: 3, + tl: /* [] */0 + } + } +}, { + hd: -1, + tl: { + hd: -2, + tl: /* [] */0 + } +}, (function (x, y) { + return x === y; +})), false); function makeTest(n) { eq("File \"bs_list_test.res\", line 341, characters 23-30", Belt_List.make(n, 3), Belt_List.makeBy(n, (function (param) { - return 3; - }))); + return 3; + }))); } eq("File \"bs_list_test.res\", line 343, characters 12-19", { + hd: 2, + tl: { + hd: 3, + tl: /* [] */0 + } +}, { + hd: 2, + tl: { + hd: 3, + tl: /* [] */0 + } +}); + +b("File \"bs_list_test.res\", line 345, characters 4-11", Belt_List.cmp({ + hd: 1, + tl: { + hd: 2, + tl: { + hd: 3, + tl: /* [] */0 + } + } +}, { + hd: 0, + tl: { + hd: 1, + tl: { hd: 2, tl: { hd: 3, tl: /* [] */0 } - }, { - hd: 2, + } + } +}, Caml.int_compare) > 0); + +b("File \"bs_list_test.res\", line 346, characters 4-11", Belt_List.cmp({ + hd: 1, + tl: { + hd: 2, + tl: { + hd: 3, tl: { - hd: 3, + hd: 4, tl: /* [] */0 } - }); - -b("File \"bs_list_test.res\", line 345, characters 4-11", Belt_List.cmp({ - hd: 1, - tl: { - hd: 2, - tl: { - hd: 3, - tl: /* [] */0 - } - } - }, { - hd: 0, - tl: { - hd: 1, - tl: { - hd: 2, - tl: { - hd: 3, - tl: /* [] */0 - } - } - } - }, Caml.int_compare) > 0); - -b("File \"bs_list_test.res\", line 346, characters 4-11", Belt_List.cmp({ - hd: 1, - tl: { - hd: 2, - tl: { - hd: 3, - tl: { - hd: 4, - tl: /* [] */0 - } - } - } - }, { - hd: 1, - tl: { - hd: 2, - tl: { - hd: 3, - tl: /* [] */0 - } - } - }, Caml.int_compare) > 0); + } + } +}, { + hd: 1, + tl: { + hd: 2, + tl: { + hd: 3, + tl: /* [] */0 + } + } +}, Caml.int_compare) > 0); b("File \"bs_list_test.res\", line 347, characters 4-11", Belt_List.cmp({ - hd: 1, - tl: { - hd: 2, - tl: { - hd: 3, - tl: /* [] */0 - } - } - }, { - hd: 1, - tl: { - hd: 2, - tl: { - hd: 3, - tl: { - hd: 4, - tl: /* [] */0 - } - } - } - }, Caml.int_compare) < 0); + hd: 1, + tl: { + hd: 2, + tl: { + hd: 3, + tl: /* [] */0 + } + } +}, { + hd: 1, + tl: { + hd: 2, + tl: { + hd: 3, + tl: { + hd: 4, + tl: /* [] */0 + } + } + } +}, Caml.int_compare) < 0); b("File \"bs_list_test.res\", line 348, characters 4-11", Belt_List.cmp({ - hd: 1, - tl: { - hd: 2, - tl: { - hd: 3, - tl: /* [] */0 - } - } - }, { - hd: 0, - tl: { - hd: 1, - tl: { - hd: 2, - tl: /* [] */0 - } - } - }, Caml.int_compare) > 0); + hd: 1, + tl: { + hd: 2, + tl: { + hd: 3, + tl: /* [] */0 + } + } +}, { + hd: 0, + tl: { + hd: 1, + tl: { + hd: 2, + tl: /* [] */0 + } + } +}, Caml.int_compare) > 0); b("File \"bs_list_test.res\", line 349, characters 4-11", Belt_List.cmp({ - hd: 1, - tl: { - hd: 2, - tl: { - hd: 3, - tl: /* [] */0 - } - } - }, { - hd: 1, - tl: { - hd: 2, - tl: { - hd: 3, - tl: /* [] */0 - } - } - }, Caml.int_compare) === 0); + hd: 1, + tl: { + hd: 2, + tl: { + hd: 3, + tl: /* [] */0 + } + } +}, { + hd: 1, + tl: { + hd: 2, + tl: { + hd: 3, + tl: /* [] */0 + } + } +}, Caml.int_compare) === 0); b("File \"bs_list_test.res\", line 350, characters 4-11", Belt_List.cmp({ - hd: 1, - tl: { - hd: 2, - tl: { - hd: 4, - tl: /* [] */0 - } - } - }, { - hd: 1, - tl: { - hd: 2, - tl: { - hd: 3, - tl: /* [] */0 - } - } - }, Caml.int_compare) > 0); + hd: 1, + tl: { + hd: 2, + tl: { + hd: 4, + tl: /* [] */0 + } + } +}, { + hd: 1, + tl: { + hd: 2, + tl: { + hd: 3, + tl: /* [] */0 + } + } +}, Caml.int_compare) > 0); b("File \"bs_list_test.res\", line 351, characters 4-11", Belt_List.cmpByLength(/* [] */0, /* [] */0) === 0); b("File \"bs_list_test.res\", line 352, characters 4-11", Belt_List.cmpByLength({ - hd: 1, - tl: /* [] */0 - }, /* [] */0) > 0); + hd: 1, + tl: /* [] */0 +}, /* [] */0) > 0); b("File \"bs_list_test.res\", line 353, characters 4-11", Belt_List.cmpByLength(/* [] */0, { - hd: 1, - tl: /* [] */0 - }) < 0); + hd: 1, + tl: /* [] */0 +}) < 0); b("File \"bs_list_test.res\", line 354, characters 4-11", Belt_List.cmpByLength({ - hd: 1, - tl: { - hd: 2, - tl: /* [] */0 - } - }, { - hd: 1, - tl: /* [] */0 - }) > 0); + hd: 1, + tl: { + hd: 2, + tl: /* [] */0 + } +}, { + hd: 1, + tl: /* [] */0 +}) > 0); b("File \"bs_list_test.res\", line 355, characters 4-11", Belt_List.cmpByLength({ - hd: 1, - tl: /* [] */0 - }, { - hd: 1, - tl: { - hd: 2, - tl: /* [] */0 - } - }) < 0); + hd: 1, + tl: /* [] */0 +}, { + hd: 1, + tl: { + hd: 2, + tl: /* [] */0 + } +}) < 0); b("File \"bs_list_test.res\", line 356, characters 4-11", Belt_List.cmpByLength({ - hd: 1, - tl: { - hd: 3, - tl: /* [] */0 - } - }, { - hd: 1, - tl: { - hd: 2, - tl: /* [] */0 - } - }) === 0); + hd: 1, + tl: { + hd: 3, + tl: /* [] */0 + } +}, { + hd: 1, + tl: { + hd: 2, + tl: /* [] */0 + } +}) === 0); makeTest(0); @@ -2299,216 +2299,216 @@ function cmp(a, b) { } eq("SORT", Belt_List.sort({ - hd: 5, - tl: { - hd: 4, - tl: { - hd: 3, - tl: { - hd: 2, - tl: /* [] */0 - } - } - } - }, cmp), { - hd: 2, + hd: 5, + tl: { + hd: 4, + tl: { + hd: 3, tl: { - hd: 3, - tl: { - hd: 4, - tl: { - hd: 5, - tl: /* [] */0 - } - } + hd: 2, + tl: /* [] */0 + } + } + } +}, cmp), { + hd: 2, + tl: { + hd: 3, + tl: { + hd: 4, + tl: { + hd: 5, + tl: /* [] */0 } - }); + } + } +}); eq("SORT", Belt_List.sort({ - hd: 3, - tl: { - hd: 9, - tl: { - hd: 37, - tl: { - hd: 3, - tl: { - hd: 1, - tl: /* [] */0 - } - } - } - } - }, cmp), { - hd: 1, + hd: 3, + tl: { + hd: 9, + tl: { + hd: 37, tl: { hd: 3, tl: { - hd: 3, - tl: { - hd: 9, - tl: { - hd: 37, - tl: /* [] */0 - } - } + hd: 1, + tl: /* [] */0 + } + } + } + } +}, cmp), { + hd: 1, + tl: { + hd: 3, + tl: { + hd: 3, + tl: { + hd: 9, + tl: { + hd: 37, + tl: /* [] */0 } } - }); + } + } +}); b("File \"bs_list_test.res\", line 374, characters 4-11", !Belt_List.eq({ - hd: 1, - tl: { - hd: 2, - tl: { - hd: 3, - tl: /* [] */0 - } - } - }, { - hd: 1, - tl: { - hd: 2, - tl: /* [] */0 - } - }, (function (x, y) { - return x === y; - }))); + hd: 1, + tl: { + hd: 2, + tl: { + hd: 3, + tl: /* [] */0 + } + } +}, { + hd: 1, + tl: { + hd: 2, + tl: /* [] */0 + } +}, (function (x, y) { + return x === y; +}))); b("File \"bs_list_test.res\", line 375, characters 4-11", Belt_List.eq({ - hd: 1, - tl: { - hd: 2, - tl: { - hd: 3, - tl: /* [] */0 - } - } - }, { - hd: 1, - tl: { - hd: 2, - tl: { - hd: 3, - tl: /* [] */0 - } - } - }, (function (x, y) { - return x === y; - }))); + hd: 1, + tl: { + hd: 2, + tl: { + hd: 3, + tl: /* [] */0 + } + } +}, { + hd: 1, + tl: { + hd: 2, + tl: { + hd: 3, + tl: /* [] */0 + } + } +}, (function (x, y) { + return x === y; +}))); b("File \"bs_list_test.res\", line 376, characters 4-11", !Belt_List.eq({ - hd: 1, - tl: { - hd: 2, - tl: { - hd: 3, - tl: /* [] */0 - } - } - }, { - hd: 1, - tl: { - hd: 2, - tl: { - hd: 4, - tl: /* [] */0 - } - } - }, (function (x, y) { - return x === y; - }))); + hd: 1, + tl: { + hd: 2, + tl: { + hd: 3, + tl: /* [] */0 + } + } +}, { + hd: 1, + tl: { + hd: 2, + tl: { + hd: 4, + tl: /* [] */0 + } + } +}, (function (x, y) { + return x === y; +}))); b("File \"bs_list_test.res\", line 377, characters 4-11", !Belt_List.eq({ - hd: 1, - tl: { - hd: 2, - tl: { - hd: 3, - tl: /* [] */0 - } - } - }, { - hd: 1, - tl: { - hd: 2, - tl: { - hd: 3, - tl: { - hd: 4, - tl: /* [] */0 - } - } - } - }, (function (prim0, prim1) { - return prim0 === prim1; - }))); + hd: 1, + tl: { + hd: 2, + tl: { + hd: 3, + tl: /* [] */0 + } + } +}, { + hd: 1, + tl: { + hd: 2, + tl: { + hd: 3, + tl: { + hd: 4, + tl: /* [] */0 + } + } + } +}, (function (prim0, prim1) { + return prim0 === prim1; +}))); var u0 = Belt_List.makeBy(20, (function (x) { - return x; - })); + return x; +})); var u1 = Belt_List.keepMap(u0, (function (x) { - if (x % 7 === 0) { - return x + 1 | 0; - } - - })); + if (x % 7 === 0) { + return x + 1 | 0; + } + +})); eq("File \"bs_list_test.res\", line 388, characters 5-12", u1, { - hd: 1, - tl: { - hd: 8, - tl: { - hd: 15, - tl: /* [] */0 - } - } - }); + hd: 1, + tl: { + hd: 8, + tl: { + hd: 15, + tl: /* [] */0 + } + } +}); b("File \"bs_list_test.res\", line 390, characters 4-11", Caml_obj.equal(Belt_List.keepMap({ - hd: 1, - tl: { - hd: 2, - tl: { - hd: 3, - tl: { - hd: 4, - tl: /* [] */0 - } - } - } - }, (function (x) { - if (x % 2 === 0) { - return -x | 0; - } - - })), { - hd: -2, - tl: { - hd: -4, - tl: /* [] */0 - } - })); + hd: 1, + tl: { + hd: 2, + tl: { + hd: 3, + tl: { + hd: 4, + tl: /* [] */0 + } + } + } +}, (function (x) { + if (x % 2 === 0) { + return -x | 0; + } + +})), { + hd: -2, + tl: { + hd: -4, + tl: /* [] */0 + } +})); b("File \"bs_list_test.res\", line 404, characters 4-11", Belt_List.keepMap({ - hd: 1, - tl: { - hd: 2, - tl: { - hd: 3, - tl: { - hd: 4, - tl: /* [] */0 - } - } - } - }, (function (x) { - if (x % 5 === 0) { - return x; - } - - })) === /* [] */0); + hd: 1, + tl: { + hd: 2, + tl: { + hd: 3, + tl: { + hd: 4, + tl: /* [] */0 + } + } + } +}, (function (x) { + if (x % 5 === 0) { + return x; + } + +})) === /* [] */0); Mt.from_pair_suites("Bs_list_test", suites.contents); diff --git a/jscomp/test/bs_map_set_dict_test.js b/jscomp/test/bs_map_set_dict_test.js index a3d19ae5a9..8be6144f13 100644 --- a/jscomp/test/bs_map_set_dict_test.js +++ b/jscomp/test/bs_map_set_dict_test.js @@ -48,8 +48,8 @@ var m00 = { }; var I2 = Belt_Id.comparable(function (x, y) { - return Caml.int_compare(y, x); - }); + return Caml.int_compare(y, x); +}); var m_cmp = Icmp2.cmp; @@ -113,57 +113,57 @@ function $eq$tilde(a, b) { } var u0 = f(Belt_Array.map(Array_data_util.randomRange(0, 39), (function (x) { - return [ - x, - x - ]; - }))); + return [ + x, + x + ]; +}))); var u1 = Belt_Map.set(u0, 39, 120); b("File \"bs_map_set_dict_test.res\", line 72, characters 4-11", Belt_Array.every2(Belt_MapDict.toArray(u0.data), Belt_Array.map(Array_data_util.range(0, 39), (function (x) { - return [ - x, - x - ]; - })), (function (param, param$1) { - if (param[0] === param$1[0]) { - return param[1] === param$1[1]; - } else { - return false; - } - }))); + return [ + x, + x + ]; +})), (function (param, param$1) { + if (param[0] === param$1[0]) { + return param[1] === param$1[1]; + } else { + return false; + } +}))); b("File \"bs_map_set_dict_test.res\", line 79, characters 4-11", Belt_List.every2(Belt_MapDict.toList(u0.data), Belt_List.fromArray(Belt_Array.map(Array_data_util.range(0, 39), (function (x) { - return [ - x, - x - ]; - }))), (function (param, param$1) { - if (param[0] === param$1[0]) { - return param[1] === param$1[1]; - } else { - return false; - } - }))); + return [ + x, + x + ]; +}))), (function (param, param$1) { + if (param[0] === param$1[0]) { + return param[1] === param$1[1]; + } else { + return false; + } +}))); eq("File \"bs_map_set_dict_test.res\", line 84, characters 5-12", Belt_Map.get(u0, 39), 39); eq("File \"bs_map_set_dict_test.res\", line 85, characters 5-12", Belt_Map.get(u1, 39), 120); var u = f(Belt_Array.makeByAndShuffle(10000, (function (x) { - return [ - x, - x - ]; - }))); + return [ + x, + x + ]; +}))); eq("File \"bs_map_set_dict_test.res\", line 90, characters 5-12", Belt_Array.makeBy(10000, (function (x) { - return [ - x, - x - ]; - })), Belt_MapDict.toArray(u.data)); + return [ + x, + x + ]; +})), Belt_MapDict.toArray(u.data)); Mt.from_pair_suites("Bs_map_set_dict_test", suites.contents); diff --git a/jscomp/test/bs_map_test.js b/jscomp/test/bs_map_test.js index a94fb08ecd..dd411928f0 100644 --- a/jscomp/test/bs_map_test.js +++ b/jscomp/test/bs_map_test.js @@ -20,12 +20,12 @@ function eq(loc, x, y) { hd: [ loc + (" id " + String(test_id.contents)), (function (param) { - return { - TAG: "Eq", - _0: x, - _1: y - }; - }) + return { + TAG: "Eq", + _0: x, + _1: y + }; + }) ], tl: suites.contents }; @@ -37,11 +37,11 @@ function b(loc, v) { hd: [ loc + (" id " + String(test_id.contents)), (function (param) { - return { - TAG: "Ok", - _0: v - }; - }) + return { + TAG: "Ok", + _0: v + }; + }) ], tl: suites.contents }; @@ -56,11 +56,11 @@ function emptyMap(param) { } var v = Belt_Array.makeByAndShuffle(1000000, (function (i) { - return [ - i, - i - ]; - })); + return [ + i, + i + ]; +})); var u = Belt_MapInt.fromArray(v); @@ -69,8 +69,8 @@ Belt_MapInt.checkInvariantInternal(u); var firstHalf = Belt_Array.slice(v, 0, 2000); var xx = Belt_Array.reduce(firstHalf, u, (function (acc, param) { - return Belt_MapInt.remove(acc, param[0]); - })); + return Belt_MapInt.remove(acc, param[0]); +})); Belt_MapInt.checkInvariantInternal(u); diff --git a/jscomp/test/bs_min_max_test.js b/jscomp/test/bs_min_max_test.js index 850139a42f..d15a770798 100644 --- a/jscomp/test/bs_min_max_test.js +++ b/jscomp/test/bs_min_max_test.js @@ -47,23 +47,23 @@ var f5_max = Caml_obj.max; b("File \"bs_min_max_test.res\", line 19, characters 4-11", Caml.i64_eq(Caml.i64_min(Caml_int64.zero, Caml_int64.one), Caml_int64.zero)); b("File \"bs_min_max_test.res\", line 20, characters 4-11", Caml.i64_eq(Caml.i64_max([ - 0, - 22 - ], Caml_int64.one), [ - 0, - 22 - ])); + 0, + 22 +], Caml_int64.one), [ + 0, + 22 +])); b("File \"bs_min_max_test.res\", line 21, characters 4-11", Caml.i64_eq(Caml.i64_max([ - -1, - 4294967293 - ], [ - 0, - 3 - ]), [ - 0, - 3 - ])); + -1, + 4294967293 +], [ + 0, + 3 +]), [ + 0, + 3 +])); eq("File \"bs_min_max_test.res\", line 22, characters 5-12", Caml_obj.min(undefined, 3), undefined); diff --git a/jscomp/test/bs_mutable_set_test.js b/jscomp/test/bs_mutable_set_test.js index bc6b575833..8348831a38 100644 --- a/jscomp/test/bs_mutable_set_test.js +++ b/jscomp/test/bs_mutable_set_test.js @@ -114,40 +114,40 @@ var v = { }; var bs = Belt_Array.map(Array_data_util.randomRange(500, 1499), (function (x) { - return Belt_MutableSetInt.removeCheck(v, x); - })); + return Belt_MutableSetInt.removeCheck(v, x); +})); var indeedRemoved = Belt_Array.reduce(bs, 0, (function (acc, x) { - if (x) { - return acc + 1 | 0; - } else { - return acc; - } - })); + if (x) { + return acc + 1 | 0; + } else { + return acc; + } +})); eq("File \"bs_mutable_set_test.res\", line 72, characters 9-16", indeedRemoved, 500); eq("File \"bs_mutable_set_test.res\", line 73, characters 9-16", Belt_internalAVLset.size(v.data), 501); var cs = Belt_Array.map(Array_data_util.randomRange(500, 2000), (function (x) { - return Belt_MutableSetInt.addCheck(v, x); - })); + return Belt_MutableSetInt.addCheck(v, x); +})); var indeedAded = Belt_Array.reduce(cs, 0, (function (acc, x) { - if (x) { - return acc + 1 | 0; - } else { - return acc; - } - })); + if (x) { + return acc + 1 | 0; + } else { + return acc; + } +})); eq("File \"bs_mutable_set_test.res\", line 82, characters 9-16", indeedAded, 1000); eq("File \"bs_mutable_set_test.res\", line 83, characters 9-16", Belt_internalAVLset.size(v.data), 1501); b("File \"bs_mutable_set_test.res\", line 84, characters 8-15", Belt_MutableSetInt.isEmpty({ - data: undefined - })); + data: undefined +})); eq("File \"bs_mutable_set_test.res\", line 85, characters 9-16", Belt_internalAVLset.minimum(v.data), 500); @@ -158,14 +158,14 @@ eq("File \"bs_mutable_set_test.res\", line 87, characters 9-16", Belt_internalAV eq("File \"bs_mutable_set_test.res\", line 88, characters 9-16", Belt_internalAVLset.maxUndefined(v.data), 2000); eq("File \"bs_mutable_set_test.res\", line 89, characters 9-16", Belt_MutableSetInt.reduce(v, 0, (function (x, y) { - return x + y | 0; - })), 1876250); + return x + y | 0; +})), 1876250); b("File \"bs_mutable_set_test.res\", line 90, characters 8-15", Belt_List.eq(Belt_internalAVLset.toList(v.data), Belt_List.makeBy(1501, (function (i) { - return i + 500 | 0; - })), (function (x, y) { - return x === y; - }))); + return i + 500 | 0; +})), (function (x, y) { + return x === y; +}))); eq("File \"bs_mutable_set_test.res\", line 91, characters 9-16", Belt_internalAVLset.toArray(v.data), Array_data_util.range(500, 2000)); @@ -186,12 +186,12 @@ var aa = match$1[0]; b("File \"bs_mutable_set_test.res\", line 96, characters 8-15", match[1]); b("File \"bs_mutable_set_test.res\", line 97, characters 8-15", Belt_Array.eq(Belt_internalAVLset.toArray(aa.data), Array_data_util.range(500, 999), (function (x, y) { - return x === y; - }))); + return x === y; +}))); b("File \"bs_mutable_set_test.res\", line 98, characters 8-15", Belt_Array.eq(Belt_internalAVLset.toArray(bb.data), Array_data_util.range(1001, 2000), (function (prim0, prim1) { - return prim0 === prim1; - }))); + return prim0 === prim1; +}))); b("File \"bs_mutable_set_test.res\", line 99, characters 8-15", Belt_MutableSetInt.subset(aa, v)); @@ -214,12 +214,12 @@ var aa$1 = match$3[0]; b("File \"bs_mutable_set_test.res\", line 105, characters 8-15", !match$2[1]); b("File \"bs_mutable_set_test.res\", line 106, characters 8-15", Belt_Array.eq(Belt_internalAVLset.toArray(aa$1.data), Array_data_util.range(500, 999), (function (prim0, prim1) { - return prim0 === prim1; - }))); + return prim0 === prim1; +}))); b("File \"bs_mutable_set_test.res\", line 107, characters 8-15", Belt_Array.eq(Belt_internalAVLset.toArray(bb$1.data), Array_data_util.range(1001, 2000), (function (prim0, prim1) { - return prim0 === prim1; - }))); + return prim0 === prim1; +}))); b("File \"bs_mutable_set_test.res\", line 108, characters 8-15", Belt_MutableSetInt.subset(aa$1, v)); @@ -244,8 +244,8 @@ var cc = Belt_MutableSetInt.union(aa$2, bb$2); var xs$4 = Array_data_util.randomRange(0, 120); b("File \"bs_mutable_set_test.res\", line 120, characters 8-15", Belt_MutableSetInt.eq(cc, { - data: Belt_internalSetInt.fromArray(xs$4) - })); + data: Belt_internalSetInt.fromArray(xs$4) +})); var xs$5 = Array_data_util.randomRange(0, 20); @@ -254,81 +254,81 @@ var xs$6 = Array_data_util.randomRange(21, 40); var xs$7 = Array_data_util.randomRange(0, 40); b("File \"bs_mutable_set_test.res\", line 123, characters 8-15", Belt_MutableSetInt.eq(Belt_MutableSetInt.union({ - data: Belt_internalSetInt.fromArray(xs$5) - }, { - data: Belt_internalSetInt.fromArray(xs$6) - }), { - data: Belt_internalSetInt.fromArray(xs$7) - })); + data: Belt_internalSetInt.fromArray(xs$5) +}, { + data: Belt_internalSetInt.fromArray(xs$6) +}), { + data: Belt_internalSetInt.fromArray(xs$7) +})); var dd = Belt_MutableSetInt.intersect(aa$2, bb$2); var xs$8 = Array_data_util.randomRange(40, 100); b("File \"bs_mutable_set_test.res\", line 127, characters 8-15", Belt_MutableSetInt.eq(dd, { - data: Belt_internalSetInt.fromArray(xs$8) - })); + data: Belt_internalSetInt.fromArray(xs$8) +})); var xs$9 = Array_data_util.randomRange(0, 20); var xs$10 = Array_data_util.randomRange(21, 40); b("File \"bs_mutable_set_test.res\", line 129, characters 8-15", Belt_MutableSetInt.eq(Belt_MutableSetInt.intersect({ - data: Belt_internalSetInt.fromArray(xs$9) - }, { - data: Belt_internalSetInt.fromArray(xs$10) - }), { - data: undefined - })); + data: Belt_internalSetInt.fromArray(xs$9) +}, { + data: Belt_internalSetInt.fromArray(xs$10) +}), { + data: undefined +})); var xs$11 = Array_data_util.randomRange(21, 40); var xs$12 = Array_data_util.randomRange(0, 20); b("File \"bs_mutable_set_test.res\", line 136, characters 8-15", Belt_MutableSetInt.eq(Belt_MutableSetInt.intersect({ - data: Belt_internalSetInt.fromArray(xs$11) - }, { - data: Belt_internalSetInt.fromArray(xs$12) - }), { - data: undefined - })); + data: Belt_internalSetInt.fromArray(xs$11) +}, { + data: Belt_internalSetInt.fromArray(xs$12) +}), { + data: undefined +})); b("File \"bs_mutable_set_test.res\", line 142, characters 8-15", Belt_MutableSetInt.eq(Belt_MutableSetInt.intersect({ - data: Belt_internalSetInt.fromArray([ - 1, - 3, - 4, - 5, - 7, - 9 - ]) - }, { - data: Belt_internalSetInt.fromArray([ - 2, - 4, - 5, - 6, - 8, - 10 - ]) - }), { - data: Belt_internalSetInt.fromArray([ - 4, - 5 - ]) - })); + data: Belt_internalSetInt.fromArray([ + 1, + 3, + 4, + 5, + 7, + 9 + ]) +}, { + data: Belt_internalSetInt.fromArray([ + 2, + 4, + 5, + 6, + 8, + 10 + ]) +}), { + data: Belt_internalSetInt.fromArray([ + 4, + 5 + ]) +})); var xs$13 = Array_data_util.randomRange(0, 39); b("File \"bs_mutable_set_test.res\", line 143, characters 8-15", Belt_MutableSetInt.eq(Belt_MutableSetInt.diff(aa$2, bb$2), { - data: Belt_internalSetInt.fromArray(xs$13) - })); + data: Belt_internalSetInt.fromArray(xs$13) +})); var xs$14 = Array_data_util.randomRange(101, 120); b("File \"bs_mutable_set_test.res\", line 144, characters 8-15", Belt_MutableSetInt.eq(Belt_MutableSetInt.diff(bb$2, aa$2), { - data: Belt_internalSetInt.fromArray(xs$14) - })); + data: Belt_internalSetInt.fromArray(xs$14) +})); var xs$15 = Array_data_util.randomRange(21, 40); @@ -337,12 +337,12 @@ var xs$16 = Array_data_util.randomRange(0, 20); var xs$17 = Array_data_util.randomRange(21, 40); b("File \"bs_mutable_set_test.res\", line 146, characters 8-15", Belt_MutableSetInt.eq(Belt_MutableSetInt.diff({ - data: Belt_internalSetInt.fromArray(xs$15) - }, { - data: Belt_internalSetInt.fromArray(xs$16) - }), { - data: Belt_internalSetInt.fromArray(xs$17) - })); + data: Belt_internalSetInt.fromArray(xs$15) +}, { + data: Belt_internalSetInt.fromArray(xs$16) +}), { + data: Belt_internalSetInt.fromArray(xs$17) +})); var xs$18 = Array_data_util.randomRange(0, 20); @@ -351,12 +351,12 @@ var xs$19 = Array_data_util.randomRange(21, 40); var xs$20 = Array_data_util.randomRange(0, 20); b("File \"bs_mutable_set_test.res\", line 153, characters 8-15", Belt_MutableSetInt.eq(Belt_MutableSetInt.diff({ - data: Belt_internalSetInt.fromArray(xs$18) - }, { - data: Belt_internalSetInt.fromArray(xs$19) - }), { - data: Belt_internalSetInt.fromArray(xs$20) - })); + data: Belt_internalSetInt.fromArray(xs$18) +}, { + data: Belt_internalSetInt.fromArray(xs$19) +}), { + data: Belt_internalSetInt.fromArray(xs$20) +})); var xs$21 = Array_data_util.randomRange(0, 20); @@ -365,12 +365,12 @@ var xs$22 = Array_data_util.randomRange(0, 40); var xs$23 = Array_data_util.randomRange(0, -1); b("File \"bs_mutable_set_test.res\", line 161, characters 8-15", Belt_MutableSetInt.eq(Belt_MutableSetInt.diff({ - data: Belt_internalSetInt.fromArray(xs$21) - }, { - data: Belt_internalSetInt.fromArray(xs$22) - }), { - data: Belt_internalSetInt.fromArray(xs$23) - })); + data: Belt_internalSetInt.fromArray(xs$21) +}, { + data: Belt_internalSetInt.fromArray(xs$22) +}), { + data: Belt_internalSetInt.fromArray(xs$23) +})); var xs$24 = Array_data_util.randomRange(0, 1000); @@ -379,16 +379,16 @@ var a0 = { }; var a1 = Belt_MutableSetInt.keep(a0, (function (x) { - return x % 2 === 0; - })); + return x % 2 === 0; +})); var a2 = Belt_MutableSetInt.keep(a0, (function (x) { - return x % 2 !== 0; - })); + return x % 2 !== 0; +})); var match$4 = Belt_MutableSetInt.partition(a0, (function (x) { - return x % 2 === 0; - })); + return x % 2 === 0; +})); var a4 = match$4[1]; @@ -399,23 +399,23 @@ b("File \"bs_mutable_set_test.res\", line 173, characters 8-15", Belt_MutableSet b("File \"bs_mutable_set_test.res\", line 174, characters 8-15", Belt_MutableSetInt.eq(a2, a4)); Belt_List.forEach({ - hd: a0, + hd: a0, + tl: { + hd: a1, + tl: { + hd: a2, tl: { - hd: a1, + hd: a3, tl: { - hd: a2, - tl: { - hd: a3, - tl: { - hd: a4, - tl: /* [] */0 - } - } + hd: a4, + tl: /* [] */0 } } - }, (function (x) { - Belt_internalAVLset.checkInvariantInternal(x.data); - })); + } + } +}, (function (x) { + Belt_internalAVLset.checkInvariantInternal(x.data); +})); var v$1 = { data: undefined @@ -428,8 +428,8 @@ for(var i$2 = 0; i$2 <= 100000; ++i$2){ Belt_internalAVLset.checkInvariantInternal(v$1.data); b("File \"bs_mutable_set_test.res\", line 188, characters 10-17", Belt_Range.every(0, 100000, (function (i) { - return Belt_internalSetInt.has(v$1.data, i); - }))); + return Belt_internalSetInt.has(v$1.data, i); +}))); eq("File \"bs_mutable_set_test.res\", line 189, characters 5-12", Belt_internalAVLset.size(v$1.data), 100001); @@ -472,8 +472,8 @@ eq("File \"bs_mutable_set_test.res\", line 216, characters 5-12", Belt_internalA b("File \"bs_mutable_set_test.res\", line 217, characters 4-11", Belt_MutableSetInt.isEmpty(v$3)); var xs$25 = Belt_Array.makeBy(30, (function (i) { - return i; - })); + return i; +})); var v$4 = { data: Belt_internalSetInt.fromArray(xs$25) @@ -505,8 +505,8 @@ function id(loc, x) { }; Belt_internalAVLset.checkInvariantInternal(u.data); b(loc, Belt_Array.every2(Belt_internalAVLset.toArray(u.data), x, (function (prim0, prim1) { - return prim0 === prim1; - }))); + return prim0 === prim1; + }))); } id("File \"bs_mutable_set_test.res\", line 242, characters 5-12", []); @@ -514,81 +514,81 @@ id("File \"bs_mutable_set_test.res\", line 242, characters 5-12", []); id("File \"bs_mutable_set_test.res\", line 243, characters 5-12", [0]); id("File \"bs_mutable_set_test.res\", line 244, characters 5-12", [ - 0, - 1 - ]); + 0, + 1 +]); id("File \"bs_mutable_set_test.res\", line 245, characters 5-12", [ - 0, - 1, - 2 - ]); + 0, + 1, + 2 +]); id("File \"bs_mutable_set_test.res\", line 246, characters 5-12", [ - 0, - 1, - 2, - 3 - ]); + 0, + 1, + 2, + 3 +]); id("File \"bs_mutable_set_test.res\", line 247, characters 5-12", [ - 0, - 1, - 2, - 3, - 4 - ]); + 0, + 1, + 2, + 3, + 4 +]); id("File \"bs_mutable_set_test.res\", line 248, characters 5-12", [ - 0, - 1, - 2, - 3, - 4, - 5 - ]); + 0, + 1, + 2, + 3, + 4, + 5 +]); id("File \"bs_mutable_set_test.res\", line 249, characters 5-12", [ - 0, - 1, - 2, - 3, - 4, - 6 - ]); + 0, + 1, + 2, + 3, + 4, + 6 +]); id("File \"bs_mutable_set_test.res\", line 250, characters 5-12", [ - 0, - 1, - 2, - 3, - 4, - 6, - 7 - ]); + 0, + 1, + 2, + 3, + 4, + 6, + 7 +]); id("File \"bs_mutable_set_test.res\", line 251, characters 5-12", [ - 0, - 1, - 2, - 3, - 4, - 6, - 7, - 8 - ]); + 0, + 1, + 2, + 3, + 4, + 6, + 7, + 8 +]); id("File \"bs_mutable_set_test.res\", line 252, characters 5-12", [ - 0, - 1, - 2, - 3, - 4, - 6, - 7, - 8, - 9 - ]); + 0, + 1, + 2, + 3, + 4, + 6, + 7, + 8, + 9 +]); id("File \"bs_mutable_set_test.res\", line 253, characters 5-12", Array_data_util.range(0, 1000)); @@ -599,16 +599,16 @@ var v$5 = { }; var copyV = Belt_MutableSetInt.keep(v$5, (function (x) { - return x % 8 === 0; - })); + return x % 8 === 0; +})); var match$5 = Belt_MutableSetInt.partition(v$5, (function (x) { - return x % 8 === 0; - })); + return x % 8 === 0; +})); var cc$1 = Belt_MutableSetInt.keep(v$5, (function (x) { - return x % 8 !== 0; - })); + return x % 8 !== 0; +})); for(var i$6 = 0; i$6 <= 200; ++i$6){ Belt_MutableSetInt.remove(v$5, i$6); @@ -617,8 +617,8 @@ for(var i$6 = 0; i$6 <= 200; ++i$6){ eq("File \"bs_mutable_set_test.res\", line 264, characters 5-12", Belt_internalAVLset.size(copyV.data), 126); eq("File \"bs_mutable_set_test.res\", line 265, characters 5-12", Belt_internalAVLset.toArray(copyV.data), Belt_Array.makeBy(126, (function (i) { - return (i << 3); - }))); + return (i << 3); +}))); eq("File \"bs_mutable_set_test.res\", line 266, characters 5-12", Belt_internalAVLset.size(v$5.data), 800); @@ -639,18 +639,18 @@ var match$7 = match$6[0]; var xs$28 = Array_data_util.randomRange(0, 399); b("File \"bs_mutable_set_test.res\", line 274, characters 4-11", Belt_MutableSetInt.eq(match$7[0], { - data: Belt_internalSetInt.fromArray(xs$28) - })); + data: Belt_internalSetInt.fromArray(xs$28) +})); var xs$29 = Array_data_util.randomRange(401, 1000); b("File \"bs_mutable_set_test.res\", line 275, characters 4-11", Belt_MutableSetInt.eq(match$7[1], { - data: Belt_internalSetInt.fromArray(xs$29) - })); + data: Belt_internalSetInt.fromArray(xs$29) +})); var xs$30 = Belt_Array.map(Array_data_util.randomRange(0, 1000), (function (x) { - return (x << 1); - })); + return (x << 1); +})); var d = { data: Belt_internalSetInt.fromArray(xs$30) @@ -661,20 +661,20 @@ var match$8 = Belt_MutableSetInt.split(d, 1001); var match$9 = match$8[0]; var xs$31 = Belt_Array.makeBy(501, (function (x) { - return (x << 1); - })); + return (x << 1); +})); b("File \"bs_mutable_set_test.res\", line 278, characters 4-11", Belt_MutableSetInt.eq(match$9[0], { - data: Belt_internalSetInt.fromArray(xs$31) - })); + data: Belt_internalSetInt.fromArray(xs$31) +})); var xs$32 = Belt_Array.makeBy(500, (function (x) { - return 1002 + (x << 1) | 0; - })); + return 1002 + (x << 1) | 0; +})); b("File \"bs_mutable_set_test.res\", line 279, characters 4-11", Belt_MutableSetInt.eq(match$9[1], { - data: Belt_internalSetInt.fromArray(xs$32) - })); + data: Belt_internalSetInt.fromArray(xs$32) +})); var xs$33 = Array_data_util.randomRange(0, 100); @@ -693,8 +693,8 @@ var cc$2 = Belt_MutableSetInt.union(aa$3, bb$3); var xs$35 = Array_data_util.randomRange(0, 120); b("File \"bs_mutable_set_test.res\", line 289, characters 4-11", Belt_MutableSetInt.eq(cc$2, { - data: Belt_internalSetInt.fromArray(xs$35) - })); + data: Belt_internalSetInt.fromArray(xs$35) +})); var xs$36 = Array_data_util.randomRange(0, 20); @@ -703,81 +703,81 @@ var xs$37 = Array_data_util.randomRange(21, 40); var xs$38 = Array_data_util.randomRange(0, 40); b("File \"bs_mutable_set_test.res\", line 292, characters 4-11", Belt_MutableSetInt.eq(Belt_MutableSetInt.union({ - data: Belt_internalSetInt.fromArray(xs$36) - }, { - data: Belt_internalSetInt.fromArray(xs$37) - }), { - data: Belt_internalSetInt.fromArray(xs$38) - })); + data: Belt_internalSetInt.fromArray(xs$36) +}, { + data: Belt_internalSetInt.fromArray(xs$37) +}), { + data: Belt_internalSetInt.fromArray(xs$38) +})); var dd$1 = Belt_MutableSetInt.intersect(aa$3, bb$3); var xs$39 = Array_data_util.randomRange(40, 100); b("File \"bs_mutable_set_test.res\", line 296, characters 4-11", Belt_MutableSetInt.eq(dd$1, { - data: Belt_internalSetInt.fromArray(xs$39) - })); + data: Belt_internalSetInt.fromArray(xs$39) +})); var xs$40 = Array_data_util.randomRange(0, 20); var xs$41 = Array_data_util.randomRange(21, 40); b("File \"bs_mutable_set_test.res\", line 298, characters 4-11", Belt_MutableSetInt.eq(Belt_MutableSetInt.intersect({ - data: Belt_internalSetInt.fromArray(xs$40) - }, { - data: Belt_internalSetInt.fromArray(xs$41) - }), { - data: undefined - })); + data: Belt_internalSetInt.fromArray(xs$40) +}, { + data: Belt_internalSetInt.fromArray(xs$41) +}), { + data: undefined +})); var xs$42 = Array_data_util.randomRange(21, 40); var xs$43 = Array_data_util.randomRange(0, 20); b("File \"bs_mutable_set_test.res\", line 302, characters 4-11", Belt_MutableSetInt.eq(Belt_MutableSetInt.intersect({ - data: Belt_internalSetInt.fromArray(xs$42) - }, { - data: Belt_internalSetInt.fromArray(xs$43) - }), { - data: undefined - })); + data: Belt_internalSetInt.fromArray(xs$42) +}, { + data: Belt_internalSetInt.fromArray(xs$43) +}), { + data: undefined +})); b("File \"bs_mutable_set_test.res\", line 305, characters 4-11", Belt_MutableSetInt.eq(Belt_MutableSetInt.intersect({ - data: Belt_internalSetInt.fromArray([ - 1, - 3, - 4, - 5, - 7, - 9 - ]) - }, { - data: Belt_internalSetInt.fromArray([ - 2, - 4, - 5, - 6, - 8, - 10 - ]) - }), { - data: Belt_internalSetInt.fromArray([ - 4, - 5 - ]) - })); + data: Belt_internalSetInt.fromArray([ + 1, + 3, + 4, + 5, + 7, + 9 + ]) +}, { + data: Belt_internalSetInt.fromArray([ + 2, + 4, + 5, + 6, + 8, + 10 + ]) +}), { + data: Belt_internalSetInt.fromArray([ + 4, + 5 + ]) +})); var xs$44 = Array_data_util.randomRange(0, 39); b("File \"bs_mutable_set_test.res\", line 306, characters 4-11", Belt_MutableSetInt.eq(Belt_MutableSetInt.diff(aa$3, bb$3), { - data: Belt_internalSetInt.fromArray(xs$44) - })); + data: Belt_internalSetInt.fromArray(xs$44) +})); var xs$45 = Array_data_util.randomRange(101, 120); b("File \"bs_mutable_set_test.res\", line 307, characters 4-11", Belt_MutableSetInt.eq(Belt_MutableSetInt.diff(bb$3, aa$3), { - data: Belt_internalSetInt.fromArray(xs$45) - })); + data: Belt_internalSetInt.fromArray(xs$45) +})); var xs$46 = Array_data_util.randomRange(21, 40); @@ -786,12 +786,12 @@ var xs$47 = Array_data_util.randomRange(0, 20); var xs$48 = Array_data_util.randomRange(21, 40); b("File \"bs_mutable_set_test.res\", line 309, characters 4-11", Belt_MutableSetInt.eq(Belt_MutableSetInt.diff({ - data: Belt_internalSetInt.fromArray(xs$46) - }, { - data: Belt_internalSetInt.fromArray(xs$47) - }), { - data: Belt_internalSetInt.fromArray(xs$48) - })); + data: Belt_internalSetInt.fromArray(xs$46) +}, { + data: Belt_internalSetInt.fromArray(xs$47) +}), { + data: Belt_internalSetInt.fromArray(xs$48) +})); var xs$49 = Array_data_util.randomRange(0, 20); @@ -800,12 +800,12 @@ var xs$50 = Array_data_util.randomRange(21, 40); var xs$51 = Array_data_util.randomRange(0, 20); b("File \"bs_mutable_set_test.res\", line 316, characters 4-11", Belt_MutableSetInt.eq(Belt_MutableSetInt.diff({ - data: Belt_internalSetInt.fromArray(xs$49) - }, { - data: Belt_internalSetInt.fromArray(xs$50) - }), { - data: Belt_internalSetInt.fromArray(xs$51) - })); + data: Belt_internalSetInt.fromArray(xs$49) +}, { + data: Belt_internalSetInt.fromArray(xs$50) +}), { + data: Belt_internalSetInt.fromArray(xs$51) +})); var xs$52 = Array_data_util.randomRange(0, 20); @@ -814,12 +814,12 @@ var xs$53 = Array_data_util.randomRange(0, 40); var xs$54 = Array_data_util.randomRange(0, -1); b("File \"bs_mutable_set_test.res\", line 324, characters 4-11", Belt_MutableSetInt.eq(Belt_MutableSetInt.diff({ - data: Belt_internalSetInt.fromArray(xs$52) - }, { - data: Belt_internalSetInt.fromArray(xs$53) - }), { - data: Belt_internalSetInt.fromArray(xs$54) - })); + data: Belt_internalSetInt.fromArray(xs$52) +}, { + data: Belt_internalSetInt.fromArray(xs$53) +}), { + data: Belt_internalSetInt.fromArray(xs$54) +})); Mt.from_pair_suites("Bs_mutable_set_test", suites.contents); diff --git a/jscomp/test/bs_poly_map_test.js b/jscomp/test/bs_poly_map_test.js index 0ea395f0a2..6e91009013 100644 --- a/jscomp/test/bs_poly_map_test.js +++ b/jscomp/test/bs_poly_map_test.js @@ -46,41 +46,41 @@ function emptyMap(param) { function mergeInter(s1, s2) { var m = Belt_Map.merge(s1, s2, (function (k, v1, v2) { - if (v1 !== undefined && v2 !== undefined) { - return Caml_option.some(undefined); - } - - })); + if (v1 !== undefined && v2 !== undefined) { + return Caml_option.some(undefined); + } + + })); return Belt_Set.fromArray(Belt_MapDict.keysToArray(m.data), Icmp); } function mergeUnion(s1, s2) { var m = Belt_Map.merge(s1, s2, (function (k, v1, v2) { - if (v1 !== undefined || v2 !== undefined) { - return Caml_option.some(undefined); - } - - })); + if (v1 !== undefined || v2 !== undefined) { + return Caml_option.some(undefined); + } + + })); return Belt_Set.fromArray(Belt_MapDict.keysToArray(m.data), Icmp); } function mergeDiff(s1, s2) { var m = Belt_Map.merge(s1, s2, (function (k, v1, v2) { - if (v1 !== undefined && v2 === undefined) { - return Caml_option.some(undefined); - } - - })); + if (v1 !== undefined && v2 === undefined) { + return Caml_option.some(undefined); + } + + })); return Belt_Set.fromArray(Belt_MapDict.keysToArray(m.data), Icmp); } function randomRange(i, j) { return Belt_Array.map(Array_data_util.randomRange(i, j), (function (x) { - return [ - x, - x - ]; - })); + return [ + x, + x + ]; + })); } var u0 = Belt_Map.fromArray(randomRange(0, 100), Icmp); @@ -102,19 +102,19 @@ var a1 = Belt_Map.set(a0, 3, 33); var a2 = Belt_Map.remove(a1, 3); var a3 = Belt_Map.update(a2, 3, (function (k) { - if (k !== undefined) { - return k + 1 | 0; - } else { - return 11; - } - })); + if (k !== undefined) { + return k + 1 | 0; + } else { + return 11; + } +})); var a4 = Belt_Map.update(a2, 3, (function (k) { - if (k !== undefined) { - return k + 1 | 0; - } - - })); + if (k !== undefined) { + return k + 1 | 0; + } + +})); var a5 = Belt_Map.remove(a0, 3); @@ -137,23 +137,23 @@ b("File \"bs_poly_map_test.res\", line 95, characters 4-11", 11 === Belt_Map.get b("File \"bs_poly_map_test.res\", line 96, characters 4-11", Belt_Map.getUndefined(a4, 3) === undefined); var a7 = Belt_Map.removeMany(a0, [ - 7, - 8, - 0, - 1, - 3, - 2, - 4, - 922, - 4, - 5, - 6 - ]); + 7, + 8, + 0, + 1, + 3, + 2, + 4, + 922, + 4, + 5, + 6 +]); eq("File \"bs_poly_map_test.res\", line 99, characters 5-12", Belt_MapDict.keysToArray(a7.data), [ - 9, - 10 - ]); + 9, + 10 +]); var a8 = Belt_Map.removeMany(a7, Array_data_util.randomRange(0, 100)); @@ -169,14 +169,14 @@ eq("File \"bs_poly_map_test.res\", line 109, characters 5-12", Belt_Map.get(u0$1 function acc(m, is) { return Belt_Array.reduce(is, m, (function (a, i) { - return Belt_Map.update(a, i, (function (n) { - if (n !== undefined) { - return n + 1 | 0; - } else { - return 1; - } - })); - })); + return Belt_Map.update(a, i, (function (n) { + if (n !== undefined) { + return n + 1 | 0; + } else { + return 1; + } + })); + })); } var m_cmp = Icmp.cmp; @@ -189,13 +189,13 @@ var m = { var m1 = acc(m, Belt_Array.concat(Array_data_util.randomRange(0, 20), Array_data_util.randomRange(10, 30))); b("File \"bs_poly_map_test.res\", line 126, characters 4-11", Belt_Map.eq(m1, Belt_Map.fromArray(Belt_Array.makeBy(31, (function (i) { - return [ - i, - i >= 10 && i <= 20 ? 2 : 1 - ]; - })), Icmp), (function (x, y) { - return x === y; - }))); + return [ + i, + i >= 10 && i <= 20 ? 2 : 1 + ]; +})), Icmp), (function (x, y) { + return x === y; +}))); var v0_cmp = Icmp.cmp; @@ -205,22 +205,22 @@ var v0 = { }; var v1 = Belt_Map.mergeMany(v0, Belt_Array.map(Array_data_util.randomRange(0, 10000), (function (x) { - return [ - x, - x - ]; - }))); + return [ + x, + x + ]; +}))); var v2 = Belt_Map.fromArray(Belt_Array.map(Array_data_util.randomRange(0, 10000), (function (x) { - return [ - x, - x - ]; - })), Icmp); + return [ + x, + x + ]; +})), Icmp); b("File \"bs_poly_map_test.res\", line 150, characters 4-11", Belt_Map.eq(v1, v2, (function (x, y) { - return x === y; - }))); + return x === y; +}))); function inc(x) { if (x !== undefined) { @@ -253,32 +253,32 @@ var match$4 = Belt_Map.get(v4, -10); b("File \"bs_poly_map_test.res\", line 175, characters 4-11", match$4 !== undefined ? match$4 === 0 : false); var map = Belt_Map.remove({ - cmp: Icmp.cmp, - data: undefined - }, 0); + cmp: Icmp.cmp, + data: undefined +}, 0); b("File \"bs_poly_map_test.res\", line 181, characters 4-11", Belt_MapDict.isEmpty(map.data)); var map$1 = Belt_Map.removeMany({ - cmp: Icmp.cmp, - data: undefined - }, [0]); + cmp: Icmp.cmp, + data: undefined +}, [0]); b("File \"bs_poly_map_test.res\", line 182, characters 4-11", Belt_MapDict.isEmpty(map$1.data)); b("File \"bs_poly_map_test.res\", line 184, characters 4-11", pres !== undefined ? pres === 5000 : false); b("File \"bs_poly_map_test.res\", line 190, characters 4-11", Belt_Array.eq(Belt_MapDict.keysToArray(match$1[0].data), Belt_Array.makeBy(5000, (function (i) { - return i; - })), (function (prim0, prim1) { - return prim0 === prim1; - }))); + return i; +})), (function (prim0, prim1) { + return prim0 === prim1; +}))); b("File \"bs_poly_map_test.res\", line 191, characters 4-11", Belt_Array.eq(Belt_MapDict.keysToArray(match$1[1].data), Belt_Array.makeBy(5000, (function (i) { - return 5001 + i | 0; - })), (function (prim0, prim1) { - return prim0 === prim1; - }))); + return 5001 + i | 0; +})), (function (prim0, prim1) { + return prim0 === prim1; +}))); var v7 = Belt_Map.remove(v3, 5000); @@ -289,16 +289,16 @@ var match$6 = match$5[0]; b("File \"bs_poly_map_test.res\", line 196, characters 4-11", match$5[1] === undefined); b("File \"bs_poly_map_test.res\", line 202, characters 4-11", Belt_Array.eq(Belt_MapDict.keysToArray(match$6[0].data), Belt_Array.makeBy(5000, (function (i) { - return i; - })), (function (prim0, prim1) { - return prim0 === prim1; - }))); + return i; +})), (function (prim0, prim1) { + return prim0 === prim1; +}))); b("File \"bs_poly_map_test.res\", line 203, characters 4-11", Belt_Array.eq(Belt_MapDict.keysToArray(match$6[1].data), Belt_Array.makeBy(5000, (function (i) { - return 5001 + i | 0; - })), (function (prim0, prim1) { - return prim0 === prim1; - }))); + return 5001 + i | 0; +})), (function (prim0, prim1) { + return prim0 === prim1; +}))); Mt.from_pair_suites("Bs_poly_map_test", suites.contents); diff --git a/jscomp/test/bs_poly_mutable_map_test.js b/jscomp/test/bs_poly_mutable_map_test.js index 314cb7a4d8..2e4816b6e0 100644 --- a/jscomp/test/bs_poly_mutable_map_test.js +++ b/jscomp/test/bs_poly_mutable_map_test.js @@ -38,11 +38,11 @@ function ff(x) { function randomRange(i, j) { return Belt_Array.map(Array_data_util.randomRange(i, j), (function (x) { - return [ - x, - x - ]; - })); + return [ + x, + x + ]; + })); } var a0 = Belt_MutableMap.fromArray(randomRange(0, 10), Icmp); @@ -52,23 +52,23 @@ Belt_MutableMap.set(a0, 3, 33); eq("File \"bs_poly_mutable_map_test.res\", line 27, characters 5-12", Belt_MutableMap.getExn(a0, 3), 33); Belt_MutableMap.removeMany(a0, [ - 7, - 8, - 0, - 1, - 3, - 2, - 4, - 922, - 4, - 5, - 6 - ]); + 7, + 8, + 0, + 1, + 3, + 2, + 4, + 922, + 4, + 5, + 6 +]); eq("File \"bs_poly_mutable_map_test.res\", line 29, characters 5-12", Belt_internalAVLtree.keysToArray(a0.data), [ - 9, - 10 - ]); + 9, + 10 +]); Belt_MutableMap.removeMany(a0, Array_data_util.randomRange(0, 100)); @@ -79,27 +79,27 @@ var a0$1 = Belt_MutableMap.fromArray(randomRange(0, 10000), Icmp); Belt_MutableMap.set(a0$1, 2000, 33); Belt_MutableMap.removeMany(a0$1, Belt_Array.map(randomRange(0, 1998), (function (prim) { - return prim[0]; - }))); + return prim[0]; +}))); Belt_MutableMap.removeMany(a0$1, Belt_Array.map(randomRange(2002, 11000), (function (prim) { - return prim[0]; - }))); + return prim[0]; +}))); eq("File \"bs_poly_mutable_map_test.res\", line 39, characters 5-12", Belt_internalAVLtree.toArray(a0$1.data), [ - [ - 1999, - 1999 - ], - [ - 2000, - 33 - ], - [ - 2001, - 2001 - ] - ]); + [ + 1999, + 1999 + ], + [ + 2000, + 33 + ], + [ + 2001, + 2001 + ] +]); Mt.from_pair_suites("Bs_poly_mutable_map_test", suites.contents); diff --git a/jscomp/test/bs_poly_mutable_set_test.js b/jscomp/test/bs_poly_mutable_set_test.js index 1cff8858bf..1dcf4eaf38 100644 --- a/jscomp/test/bs_poly_mutable_set_test.js +++ b/jscomp/test/bs_poly_mutable_set_test.js @@ -118,41 +118,41 @@ b("File \"bs_poly_mutable_set_test.res\", line 54, characters 4-11", Belt_Mutabl var v = fromArray(Array_data_util.randomRange(1000, 2000)); var bs = Belt_Array.map(Array_data_util.randomRange(500, 1499), (function (x) { - return Belt_MutableSet.removeCheck(v, x); - })); + return Belt_MutableSet.removeCheck(v, x); +})); var indeedRemoved = Belt_Array.reduce(bs, 0, (function (acc, x) { - if (x) { - return acc + 1 | 0; - } else { - return acc; - } - })); + if (x) { + return acc + 1 | 0; + } else { + return acc; + } +})); eq("File \"bs_poly_mutable_set_test.res\", line 67, characters 5-12", indeedRemoved, 500); eq("File \"bs_poly_mutable_set_test.res\", line 68, characters 5-12", Belt_internalAVLset.size(v.data), 501); var cs = Belt_Array.map(Array_data_util.randomRange(500, 2000), (function (x) { - return Belt_MutableSet.addCheck(v, x); - })); + return Belt_MutableSet.addCheck(v, x); +})); var indeedAded = Belt_Array.reduce(cs, 0, (function (acc, x) { - if (x) { - return acc + 1 | 0; - } else { - return acc; - } - })); + if (x) { + return acc + 1 | 0; + } else { + return acc; + } +})); eq("File \"bs_poly_mutable_set_test.res\", line 77, characters 5-12", indeedAded, 1000); eq("File \"bs_poly_mutable_set_test.res\", line 78, characters 5-12", Belt_internalAVLset.size(v.data), 1501); b("File \"bs_poly_mutable_set_test.res\", line 79, characters 4-11", Belt_MutableSet.isEmpty({ - cmp: IntCmp.cmp, - data: undefined - })); + cmp: IntCmp.cmp, + data: undefined +})); eq("File \"bs_poly_mutable_set_test.res\", line 80, characters 5-12", Belt_internalAVLset.minimum(v.data), 500); @@ -163,14 +163,14 @@ eq("File \"bs_poly_mutable_set_test.res\", line 82, characters 5-12", Belt_inter eq("File \"bs_poly_mutable_set_test.res\", line 83, characters 5-12", Belt_internalAVLset.maxUndefined(v.data), 2000); eq("File \"bs_poly_mutable_set_test.res\", line 84, characters 5-12", Belt_MutableSet.reduce(v, 0, (function (x, y) { - return x + y | 0; - })), 1876250); + return x + y | 0; +})), 1876250); b("File \"bs_poly_mutable_set_test.res\", line 85, characters 4-11", Belt_List.eq(Belt_internalAVLset.toList(v.data), Belt_List.makeBy(1501, (function (i) { - return i + 500 | 0; - })), (function (x, y) { - return x === y; - }))); + return i + 500 | 0; +})), (function (x, y) { + return x === y; +}))); eq("File \"bs_poly_mutable_set_test.res\", line 86, characters 5-12", Belt_internalAVLset.toArray(v.data), Array_data_util.range(500, 2000)); @@ -191,12 +191,12 @@ var aa = match$1[0]; b("File \"bs_poly_mutable_set_test.res\", line 91, characters 4-11", match[1]); b("File \"bs_poly_mutable_set_test.res\", line 92, characters 4-11", Belt_Array.eq(Belt_internalAVLset.toArray(aa.data), Array_data_util.range(500, 999), (function (prim0, prim1) { - return prim0 === prim1; - }))); + return prim0 === prim1; +}))); b("File \"bs_poly_mutable_set_test.res\", line 93, characters 4-11", Belt_Array.eq(Belt_internalAVLset.toArray(bb.data), Array_data_util.range(1001, 2000), (function (prim0, prim1) { - return prim0 === prim1; - }))); + return prim0 === prim1; +}))); b("File \"bs_poly_mutable_set_test.res\", line 94, characters 4-11", Belt_MutableSet.subset(aa, v)); @@ -219,12 +219,12 @@ var aa$1 = match$3[0]; b("File \"bs_poly_mutable_set_test.res\", line 100, characters 4-11", !match$2[1]); b("File \"bs_poly_mutable_set_test.res\", line 101, characters 4-11", Belt_Array.eq(Belt_internalAVLset.toArray(aa$1.data), Array_data_util.range(500, 999), (function (prim0, prim1) { - return prim0 === prim1; - }))); + return prim0 === prim1; +}))); b("File \"bs_poly_mutable_set_test.res\", line 102, characters 4-11", Belt_Array.eq(Belt_internalAVLset.toArray(bb$1.data), Array_data_util.range(1001, 2000), (function (prim0, prim1) { - return prim0 === prim1; - }))); + return prim0 === prim1; +}))); b("File \"bs_poly_mutable_set_test.res\", line 103, characters 4-11", Belt_MutableSet.subset(aa$1, v)); @@ -247,33 +247,33 @@ var dd = Belt_MutableSet.intersect(aa$2, bb$2); b("File \"bs_poly_mutable_set_test.res\", line 122, characters 4-11", Belt_MutableSet.eq(dd, fromArray(Array_data_util.randomRange(40, 100)))); b("File \"bs_poly_mutable_set_test.res\", line 124, characters 4-11", Belt_MutableSet.eq(Belt_MutableSet.intersect(fromArray(Array_data_util.randomRange(0, 20)), fromArray(Array_data_util.randomRange(21, 40))), { - cmp: IntCmp.cmp, - data: undefined - })); + cmp: IntCmp.cmp, + data: undefined +})); b("File \"bs_poly_mutable_set_test.res\", line 128, characters 4-11", Belt_MutableSet.eq(Belt_MutableSet.intersect(fromArray(Array_data_util.randomRange(21, 40)), fromArray(Array_data_util.randomRange(0, 20))), { - cmp: IntCmp.cmp, - data: undefined - })); + cmp: IntCmp.cmp, + data: undefined +})); b("File \"bs_poly_mutable_set_test.res\", line 131, characters 4-11", Belt_MutableSet.eq(Belt_MutableSet.intersect(fromArray([ - 1, - 3, - 4, - 5, - 7, - 9 - ]), fromArray([ - 2, - 4, - 5, - 6, - 8, - 10 - ])), fromArray([ - 4, - 5 - ]))); + 1, + 3, + 4, + 5, + 7, + 9 +]), fromArray([ + 2, + 4, + 5, + 6, + 8, + 10 +])), fromArray([ + 4, + 5 +]))); b("File \"bs_poly_mutable_set_test.res\", line 132, characters 4-11", Belt_MutableSet.eq(Belt_MutableSet.diff(aa$2, bb$2), fromArray(Array_data_util.randomRange(0, 39)))); @@ -288,16 +288,16 @@ b("File \"bs_poly_mutable_set_test.res\", line 150, characters 4-11", Belt_Mutab var a0 = fromArray(Array_data_util.randomRange(0, 1000)); var a1 = Belt_MutableSet.keep(a0, (function (x) { - return x % 2 === 0; - })); + return x % 2 === 0; +})); var a2 = Belt_MutableSet.keep(a0, (function (x) { - return x % 2 !== 0; - })); + return x % 2 !== 0; +})); var match$4 = Belt_MutableSet.partition(a0, (function (x) { - return x % 2 === 0; - })); + return x % 2 === 0; +})); var a4 = match$4[1]; @@ -308,23 +308,23 @@ b("File \"bs_poly_mutable_set_test.res\", line 162, characters 4-11", Belt_Mutab b("File \"bs_poly_mutable_set_test.res\", line 163, characters 4-11", Belt_MutableSet.eq(a2, a4)); Belt_List.forEach({ - hd: a0, + hd: a0, + tl: { + hd: a1, + tl: { + hd: a2, tl: { - hd: a1, + hd: a3, tl: { - hd: a2, - tl: { - hd: a3, - tl: { - hd: a4, - tl: /* [] */0 - } - } + hd: a4, + tl: /* [] */0 } } - }, (function (x) { - Belt_internalAVLset.checkInvariantInternal(x.data); - })); + } + } +}, (function (x) { + Belt_internalAVLset.checkInvariantInternal(x.data); +})); Mt.from_pair_suites("Bs_poly_mutable_set_test", suites.contents); diff --git a/jscomp/test/bs_poly_set_test.js b/jscomp/test/bs_poly_set_test.js index d2a95f712b..1a76db7941 100644 --- a/jscomp/test/bs_poly_set_test.js +++ b/jscomp/test/bs_poly_set_test.js @@ -51,18 +51,18 @@ var u5 = Belt_Set.add(u4, 3); var u6 = Belt_Set.removeMany(u5, r); var u7 = Belt_Set.mergeMany(u6, [ - 0, - 1, - 2, - 0 - ]); + 0, + 1, + 2, + 0 +]); var u8 = Belt_Set.removeMany(u7, [ - 0, - 1, - 2, - 3 - ]); + 0, + 1, + 2, + 3 +]); var u9 = Belt_Set.mergeMany(u8, Array_data_util.randomRange(0, 20000)); @@ -141,13 +141,13 @@ var u24 = Belt_Set.union(u18, u17); var u25 = Belt_Set.add(u22, 59); var u26 = Belt_Set.add({ - cmp: IntCmp.cmp, - data: undefined - }, 3); + cmp: IntCmp.cmp, + data: undefined +}, 3); var ss = Belt_Array.makeByAndShuffle(100, (function (i) { - return (i << 1); - })); + return (i << 1); +})); var u27 = Belt_Set.fromArray(ss, IntCmp); @@ -200,11 +200,11 @@ function testIterToList(xs) { contents: /* [] */0 }; Belt_Set.forEach(xs, (function (x) { - v.contents = { - hd: x, - tl: v.contents - }; - })); + v.contents = { + hd: x, + tl: v.contents + }; + })); return Belt_List.reverse(v.contents); } @@ -213,11 +213,11 @@ function testIterToList2(xs) { contents: /* [] */0 }; Belt_SetDict.forEach(xs.data, (function (x) { - v.contents = { - hd: x, - tl: v.contents - }; - })); + v.contents = { + hd: x, + tl: v.contents + }; + })); return Belt_List.reverse(v.contents); } @@ -228,48 +228,48 @@ var u1$1 = Belt_Set.remove(u0$1, 17); var u2$1 = Belt_Set.add(u1$1, 33); b("File \"bs_poly_set_test.res\", line 110, characters 4-11", Belt_List.every2(testIterToList(u0$1), Belt_List.makeBy(21, (function (i) { - return i; - })), (function (x, y) { - return x === y; - }))); + return i; +})), (function (x, y) { + return x === y; +}))); b("File \"bs_poly_set_test.res\", line 111, characters 4-11", Belt_List.every2(testIterToList2(u0$1), Belt_List.makeBy(21, (function (i) { - return i; - })), (function (x, y) { - return x === y; - }))); + return i; +})), (function (x, y) { + return x === y; +}))); b("File \"bs_poly_set_test.res\", line 112, characters 4-11", Belt_List.every2(testIterToList(u0$1), Belt_SetDict.toList(u0$1.data), (function (x, y) { - return x === y; - }))); + return x === y; +}))); b("File \"bs_poly_set_test.res\", line 113, characters 4-11", Belt_Set.some(u0$1, (function (x) { - return x === 17; - }))); + return x === 17; +}))); b("File \"bs_poly_set_test.res\", line 114, characters 4-11", !Belt_Set.some(u1$1, (function (x) { - return x === 17; - }))); + return x === 17; +}))); b("File \"bs_poly_set_test.res\", line 115, characters 4-11", Belt_Set.every(u0$1, (function (x) { - return x < 24; - }))); + return x < 24; +}))); b("File \"bs_poly_set_test.res\", line 116, characters 4-11", Belt_SetDict.every(u0$1.data, (function (x) { - return x < 24; - }))); + return x < 24; +}))); b("File \"bs_poly_set_test.res\", line 117, characters 4-11", !Belt_Set.every(u2$1, (function (x) { - return x < 24; - }))); + return x < 24; +}))); b("File \"bs_poly_set_test.res\", line 118, characters 4-11", !Belt_Set.every(Belt_Set.fromArray([ - 1, - 2, - 3 - ], IntCmp), (function (x) { - return x === 2; - }))); + 1, + 2, + 3 +], IntCmp), (function (x) { + return x === 2; +}))); b("File \"bs_poly_set_test.res\", line 119, characters 4-11", Belt_Set.cmp(u1$1, u0$1) < 0); @@ -278,16 +278,16 @@ b("File \"bs_poly_set_test.res\", line 120, characters 4-11", Belt_Set.cmp(u0$1, var a0 = Belt_Set.fromArray(Array_data_util.randomRange(0, 1000), IntCmp); var a1 = Belt_Set.keep(a0, (function (x) { - return x % 2 === 0; - })); + return x % 2 === 0; +})); var a2 = Belt_Set.keep(a0, (function (x) { - return x % 2 !== 0; - })); + return x % 2 !== 0; +})); var match = Belt_Set.partition(a0, (function (x) { - return x % 2 === 0; - })); + return x % 2 === 0; +})); var a4 = match[1]; @@ -302,12 +302,12 @@ eq("File \"bs_poly_set_test.res\", line 129, characters 5-12", Belt_Set.getExn(a eq("File \"bs_poly_set_test.res\", line 130, characters 5-12", Belt_Set.getExn(a0, 4), 4); t("File \"bs_poly_set_test.res\", line 131, characters 4-11", (function (param) { - Belt_Set.getExn(a0, 1002); - })); + Belt_Set.getExn(a0, 1002); +})); t("File \"bs_poly_set_test.res\", line 132, characters 4-11", (function (param) { - Belt_Set.getExn(a0, -1); - })); + Belt_Set.getExn(a0, -1); +})); eq("File \"bs_poly_set_test.res\", line 133, characters 5-12", Belt_SetDict.size(a0.data), 1001); @@ -320,12 +320,12 @@ var match$2 = match$1[0]; b("File \"bs_poly_set_test.res\", line 136, characters 4-11", match$1[1]); eq("File \"bs_poly_set_test.res\", line 137, characters 5-12", Belt_SetDict.toArray(match$2[0].data), Belt_Array.makeBy(200, (function (i) { - return i; - }))); + return i; +}))); eq("File \"bs_poly_set_test.res\", line 138, characters 5-12", Belt_SetDict.toList(match$2[1].data), Belt_List.makeBy(800, (function (i) { - return i + 201 | 0; - }))); + return i + 201 | 0; +}))); var a7 = Belt_Set.remove(a0, 200); @@ -340,48 +340,48 @@ var a8 = match$4[0]; b("File \"bs_poly_set_test.res\", line 141, characters 4-11", !match$3[1]); eq("File \"bs_poly_set_test.res\", line 142, characters 5-12", Belt_SetDict.toArray(a8.data), Belt_Array.makeBy(200, (function (i) { - return i; - }))); + return i; +}))); eq("File \"bs_poly_set_test.res\", line 143, characters 5-12", Belt_SetDict.toList(a9.data), Belt_List.makeBy(800, (function (i) { - return i + 201 | 0; - }))); + return i + 201 | 0; +}))); eq("File \"bs_poly_set_test.res\", line 144, characters 5-12", Belt_SetDict.minimum(a8.data), 0); eq("File \"bs_poly_set_test.res\", line 145, characters 5-12", Belt_SetDict.minimum(a9.data), 201); Belt_List.forEach({ - hd: a0, + hd: a0, + tl: { + hd: a1, + tl: { + hd: a2, tl: { - hd: a1, + hd: a3, tl: { - hd: a2, - tl: { - hd: a3, - tl: { - hd: a4, - tl: /* [] */0 - } - } + hd: a4, + tl: /* [] */0 } } - }, (function (x) { - Belt_SetDict.checkInvariantInternal(x.data); - })); + } + } +}, (function (x) { + Belt_SetDict.checkInvariantInternal(x.data); +})); var a = Belt_Set.fromArray([], IntCmp); var m = Belt_Set.keep(a, (function (x) { - return x % 2 === 0; - })); + return x % 2 === 0; +})); b("File \"bs_poly_set_test.res\", line 151, characters 4-11", Belt_SetDict.isEmpty(m.data)); var match$5 = Belt_Set.split({ - cmp: IntCmp.cmp, - data: undefined - }, 0); + cmp: IntCmp.cmp, + data: undefined +}, 0); var match$6 = match$5[0]; diff --git a/jscomp/test/bs_queue_test.js b/jscomp/test/bs_queue_test.js index e62b95136c..f45e5ce2a2 100644 --- a/jscomp/test/bs_queue_test.js +++ b/jscomp/test/bs_queue_test.js @@ -69,9 +69,9 @@ if (!(Caml_obj.equal(Belt_MutableQueue.toArray((Belt_MutableQueue.add(q, 1), q)) } if (!(Caml_obj.equal(Belt_MutableQueue.toArray((Belt_MutableQueue.add(q, 2), q)), [ - 1, - 2 - ]) && q.length === 2)) { + 1, + 2 + ]) && q.length === 2)) { throw { RE_EXN_ID: "Assert_failure", _1: [ @@ -84,10 +84,10 @@ if (!(Caml_obj.equal(Belt_MutableQueue.toArray((Belt_MutableQueue.add(q, 2), q)) } if (!(Caml_obj.equal(Belt_MutableQueue.toArray((Belt_MutableQueue.add(q, 3), q)), [ - 1, - 2, - 3 - ]) && q.length === 3)) { + 1, + 2, + 3 + ]) && q.length === 3)) { throw { RE_EXN_ID: "Assert_failure", _1: [ @@ -100,11 +100,11 @@ if (!(Caml_obj.equal(Belt_MutableQueue.toArray((Belt_MutableQueue.add(q, 3), q)) } if (!(Caml_obj.equal(Belt_MutableQueue.toArray((Belt_MutableQueue.add(q, 4), q)), [ - 1, - 2, - 3, - 4 - ]) && q.length === 4)) { + 1, + 2, + 3, + 4 + ]) && q.length === 4)) { throw { RE_EXN_ID: "Assert_failure", _1: [ @@ -129,10 +129,10 @@ if (Belt_MutableQueue.popExn(q) !== 1) { } if (!(Caml_obj.equal(Belt_MutableQueue.toArray(q), [ - 2, - 3, - 4 - ]) && q.length === 3)) { + 2, + 3, + 4 + ]) && q.length === 3)) { throw { RE_EXN_ID: "Assert_failure", _1: [ @@ -157,9 +157,9 @@ if (Belt_MutableQueue.popExn(q) !== 2) { } if (!(Caml_obj.equal(Belt_MutableQueue.toArray(q), [ - 3, - 4 - ]) && q.length === 2)) { + 3, + 4 + ]) && q.length === 2)) { throw { RE_EXN_ID: "Assert_failure", _1: [ @@ -472,10 +472,10 @@ if (!does_raise(Belt_MutableQueue.popExn, q$3)) { } if (!Caml_obj.equal(q$3, { - length: 0, - first: undefined, - last: undefined - })) { + length: 0, + first: undefined, + last: undefined + })) { throw { RE_EXN_ID: "Assert_failure", _1: [ @@ -514,17 +514,17 @@ for(var i$1 = 1; i$1 <= 10; ++i$1){ var q2 = Belt_MutableQueue.copy(q1); if (!Caml_obj.equal(Belt_MutableQueue.toArray(q1), [ - 1, - 2, - 3, - 4, - 5, - 6, - 7, - 8, - 9, - 10 - ])) { + 1, + 2, + 3, + 4, + 5, + 6, + 7, + 8, + 9, + 10 + ])) { throw { RE_EXN_ID: "Assert_failure", _1: [ @@ -537,17 +537,17 @@ if (!Caml_obj.equal(Belt_MutableQueue.toArray(q1), [ } if (!Caml_obj.equal(Belt_MutableQueue.toArray(q2), [ - 1, - 2, - 3, - 4, - 5, - 6, - 7, - 8, - 9, - 10 - ])) { + 1, + 2, + 3, + 4, + 5, + 6, + 7, + 8, + 9, + 10 + ])) { throw { RE_EXN_ID: "Assert_failure", _1: [ @@ -723,19 +723,19 @@ var i$7 = { }; Belt_MutableQueue.forEach(q$5, (function (j) { - if (i$7.contents !== j) { - throw { - RE_EXN_ID: "Assert_failure", - _1: [ - "bs_queue_test.res", - 120, - 4 - ], - Error: new Error() - }; - } - i$7.contents = i$7.contents + 1 | 0; - })); + if (i$7.contents !== j) { + throw { + RE_EXN_ID: "Assert_failure", + _1: [ + "bs_queue_test.res", + 120, + 4 + ], + Error: new Error() + }; + } + i$7.contents = i$7.contents + 1 | 0; +})); var q1$1 = { length: 0, @@ -876,11 +876,11 @@ if (q1$2.length !== 4) { } if (!Caml_obj.equal(Belt_MutableQueue.toArray(q1$2), [ - 1, - 2, - 3, - 4 - ])) { + 1, + 2, + 3, + 4 + ])) { throw { RE_EXN_ID: "Assert_failure", _1: [ @@ -955,11 +955,11 @@ if (q2$2.length !== 4) { } if (!Caml_obj.equal(Belt_MutableQueue.toArray(q2$2), [ - 1, - 2, - 3, - 4 - ])) { + 1, + 2, + 3, + 4 + ])) { throw { RE_EXN_ID: "Assert_failure", _1: [ @@ -1024,11 +1024,11 @@ if (q2$3.length !== 4) { } if (!Caml_obj.equal(Belt_MutableQueue.toArray(q2$3), [ - 5, - 6, - 7, - 8 - ])) { + 5, + 6, + 7, + 8 + ])) { throw { RE_EXN_ID: "Assert_failure", _1: [ @@ -1079,11 +1079,11 @@ if (q2$3.length !== 4) { } if (!Caml_obj.equal(Belt_MutableQueue.toArray(q2$3), [ - 5, - 6, - 7, - 8 - ])) { + 5, + 6, + 7, + 8 + ])) { throw { RE_EXN_ID: "Assert_failure", _1: [ @@ -1128,11 +1128,11 @@ if (q1$4.length !== 4) { } if (!Caml_obj.equal(Belt_MutableQueue.toArray(q1$4), [ - 1, - 2, - 3, - 4 - ])) { + 1, + 2, + 3, + 4 + ])) { throw { RE_EXN_ID: "Assert_failure", _1: [ @@ -1157,11 +1157,11 @@ if (q2$4.length !== 4) { } if (!Caml_obj.equal(Belt_MutableQueue.toArray(q2$4), [ - 5, - 6, - 7, - 8 - ])) { + 5, + 6, + 7, + 8 + ])) { throw { RE_EXN_ID: "Assert_failure", _1: [ @@ -1235,10 +1235,10 @@ if (!Caml_obj.equal(Belt_MutableQueue.toArray(q2$4), v)) { } if (Belt_MutableQueue.reduce(q2$4, 0, (function (x, y) { - return x - y | 0; - })) !== Belt_Array.reduce(v, 0, (function (x, y) { - return x - y | 0; - }))) { + return x - y | 0; + })) !== Belt_Array.reduce(v, 0, (function (x, y) { + return x - y | 0; + }))) { throw { RE_EXN_ID: "Assert_failure", _1: [ @@ -1253,30 +1253,30 @@ if (Belt_MutableQueue.reduce(q2$4, 0, (function (x, y) { console.log("OK"); var q$6 = Belt_MutableQueue.fromArray([ - 1, - 2, - 3, - 4 - ]); + 1, + 2, + 3, + 4 +]); var q1$5 = Belt_MutableQueue.map(q$6, (function (x) { - return x - 1 | 0; - })); + return x - 1 | 0; +})); eq("File \"bs_queue_test.res\", line 197, characters 5-12", Belt_MutableQueue.toArray(q1$5), [ - 0, - 1, - 2, - 3 - ]); + 0, + 1, + 2, + 3 +]); var q$7 = Belt_MutableQueue.fromArray([]); b("File \"bs_queue_test.res\", line 198, characters 4-11", q$7.length === 0); var q$8 = Belt_MutableQueue.map(Belt_MutableQueue.fromArray([]), (function (x) { - return x + 1 | 0; - })); + return x + 1 | 0; +})); b("File \"bs_queue_test.res\", line 199, characters 4-11", q$8.length === 0); diff --git a/jscomp/test/bs_set_int_test.js b/jscomp/test/bs_set_int_test.js index c356c462f8..3e86d1feb4 100644 --- a/jscomp/test/bs_set_int_test.js +++ b/jscomp/test/bs_set_int_test.js @@ -33,37 +33,37 @@ function $eq$star(a, b) { } b("File \"bs_set_int_test.res\", line 21, characters 11-18", $eq$star([ - 1, - 2, - 3 - ], [ - 3, - 2, - 1 - ])); + 1, + 2, + 3 +], [ + 3, + 2, + 1 +])); var u = Belt_SetInt.intersect(Belt_SetInt.fromArray([ - 1, - 2, - 3 - ]), Belt_SetInt.fromArray([ - 3, - 4, - 5 - ])); + 1, + 2, + 3 +]), Belt_SetInt.fromArray([ + 3, + 4, + 5 +])); b("File \"bs_set_int_test.res\", line 27, characters 11-18", Belt_SetInt.eq(Belt_SetInt.fromArray([3]), u)); function range(i, j) { return $$Array.init((j - i | 0) + 1 | 0, (function (k) { - return k + i | 0; - })); + return k + i | 0; + })); } function revRange(i, j) { return $$Array.of_list(List.rev($$Array.to_list($$Array.init((j - i | 0) + 1 | 0, (function (k) { - return k + i | 0; - }))))); + return k + i | 0; + }))))); } var v = Belt_SetInt.fromArray($$Array.append(range(100, 1000), revRange(400, 1500))); @@ -73,8 +73,8 @@ var i = range(100, 1500); b("File \"bs_set_int_test.res\", line 37, characters 4-11", Belt_SetInt.eq(Belt_SetInt.fromArray(i), v)); var match = Belt_SetInt.partition(v, (function (x) { - return x % 3 === 0; - })); + return x % 3 === 0; +})); var l; @@ -144,15 +144,15 @@ var ss = [ ]; var v$1 = Belt_SetInt.fromArray([ - 1, - 222, - 3, - 4, - 2, - 0, - 33, - -1 - ]); + 1, + 222, + 3, + 4, + 2, + 0, + 33, + -1 +]); var minv = Belt_SetInt.minUndefined(v$1); @@ -163,10 +163,10 @@ function approx(loc, x, y) { } eq("File \"bs_set_int_test.res\", line 125, characters 5-12", Belt_SetInt.reduce(v$1, 0, (function (x, y) { - return x + y | 0; - })), Belt_Array.reduce(ss, 0, (function (prim0, prim1) { - return prim0 + prim1 | 0; - }))); + return x + y | 0; +})), Belt_Array.reduce(ss, 0, (function (prim0, prim1) { + return prim0 + prim1 | 0; +}))); approx("File \"bs_set_int_test.res\", line 126, characters 9-16", -1, minv); @@ -217,8 +217,8 @@ var v$10 = Belt_SetInt.remove(v$9, 1); b("File \"bs_set_int_test.res\", line 146, characters 4-11", Belt_SetInt.isEmpty(v$10)); var v$11 = Belt_Array.makeByAndShuffle(1000000, (function (i) { - return i; - })); + return i; +})); var u$1 = Belt_SetInt.fromArray(v$11); @@ -337,21 +337,21 @@ var v1 = Belt_SetInt.fromArray(Array_data_util.randomRange(1, 2001)); var v2 = Belt_SetInt.fromArray(Array_data_util.randomRange(3, 2002)); var v3 = Belt_SetInt.removeMany(v2, [ - 2002, - 2001 - ]); + 2002, + 2001 +]); var us = Belt_Array.map(Array_data_util.randomRange(1000, 3000), (function (x) { - return Belt_SetInt.has(v$12, x); - })); + return Belt_SetInt.has(v$12, x); +})); var counted = Belt_Array.reduce(us, 0, (function (acc, x) { - if (x) { - return acc + 1 | 0; - } else { - return acc; - } - })); + if (x) { + return acc + 1 | 0; + } else { + return acc; + } +})); eq("File \"bs_set_int_test.res\", line 235, characters 5-12", counted, 1001); diff --git a/jscomp/test/bs_sort_test.js b/jscomp/test/bs_sort_test.js index 1ee8bbce68..2640bf94f8 100644 --- a/jscomp/test/bs_sort_test.js +++ b/jscomp/test/bs_sort_test.js @@ -63,14 +63,14 @@ eq("File \"bs_sort_test.res\", line 36, characters 5-12", unions(Array_data_util eq("File \"bs_sort_test.res\", line 37, characters 5-12", unions(Array_data_util.range(8, 10), Array_data_util.range(9, 13)), Array_data_util.range(8, 13)); eq("File \"bs_sort_test.res\", line 38, characters 5-12", unions(Array_data_util.range(0, 2), Array_data_util.range(4, 7)), [ - 0, - 1, - 2, - 4, - 5, - 6, - 7 - ]); + 0, + 1, + 2, + 4, + 5, + 6, + 7 +]); eq("File \"bs_sort_test.res\", line 42, characters 5-12", inters(Array_data_util.range(1, 10), Array_data_util.range(3, 13)), Array_data_util.range(3, 10)); @@ -87,36 +87,36 @@ eq("File \"bs_sort_test.res\", line 50, characters 5-12", diffs(Array_data_util. eq("File \"bs_sort_test.res\", line 51, characters 5-12", diffs(Array_data_util.range(8, 10), Array_data_util.range(9, 13)), Array_data_util.range(8, 8)); eq("File \"bs_sort_test.res\", line 52, characters 5-12", diffs(Array_data_util.range(0, 2), Array_data_util.range(4, 7)), [ - 0, - 1, - 2 - ]); + 0, + 1, + 2 +]); b("File \"bs_sort_test.res\", line 56, characters 4-11", Belt_Range.every(0, 200, (function (i) { - var v = Array_data_util.randomRange(0, i); - Belt_SortArray.stableSortInPlaceBy(v, cmp); - return Belt_SortArray.isSorted(v, cmp); - }))); + var v = Array_data_util.randomRange(0, i); + Belt_SortArray.stableSortInPlaceBy(v, cmp); + return Belt_SortArray.isSorted(v, cmp); +}))); b("File \"bs_sort_test.res\", line 64, characters 4-11", Belt_Range.every(0, 200, (function (i) { - var v = Array_data_util.randomRange(0, i); - Belt_SortArray.stableSortInPlaceBy(v, cmp); - return Belt_SortArray.isSorted(v, cmp); - }))); + var v = Array_data_util.randomRange(0, i); + Belt_SortArray.stableSortInPlaceBy(v, cmp); + return Belt_SortArray.isSorted(v, cmp); +}))); b("File \"bs_sort_test.res\", line 71, characters 4-11", Belt_SortArray.isSorted([], cmp)); b("File \"bs_sort_test.res\", line 73, characters 4-11", Belt_SortArray.isSorted([0], cmp)); b("File \"bs_sort_test.res\", line 75, characters 4-11", Belt_SortArray.isSorted([ - 0, - 1 - ], cmp)); + 0, + 1 +], cmp)); b("File \"bs_sort_test.res\", line 76, characters 4-11", !Belt_SortArray.isSorted([ - 1, - 0 - ], cmp)); + 1, + 0 +], cmp)); var u = Array_data_util.randomRange(0, 1000000); @@ -164,21 +164,21 @@ var u$1 = [ ]; eq("File \"bs_sort_test.res\", line 95, characters 5-12", Belt_SortArray.stableSortBy(u$1, (function (param, param$1) { - return param[0] - param$1[0] | 0; - })), [ - [ - 1, - "a" - ], - [ - 1, - "b" - ], - [ - 2, - "a" - ] - ]); + return param[0] - param$1[0] | 0; +})), [ + [ + 1, + "a" + ], + [ + 1, + "b" + ], + [ + 2, + "a" + ] +]); var u$2 = [ [ @@ -200,25 +200,25 @@ var u$2 = [ ]; eq("File \"bs_sort_test.res\", line 98, characters 4-11", Belt_SortArray.stableSortBy(u$2, (function (param, param$1) { - return param[0] - param$1[0] | 0; - })), [ - [ - 1, - "b" - ], - [ - 1, - "a" - ], - [ - 1, - "b" - ], - [ - 2, - "a" - ] - ]); + return param[0] - param$1[0] | 0; +})), [ + [ + 1, + "b" + ], + [ + 1, + "a" + ], + [ + 1, + "b" + ], + [ + 2, + "a" + ] +]); var u$3 = [ [ @@ -248,100 +248,100 @@ var u$3 = [ ]; eq("File \"bs_sort_test.res\", line 104, characters 4-11", Belt_SortArray.stableSortBy(u$3, (function (param, param$1) { - return param[0] - param$1[0] | 0; - })), [ - [ - 1, - "c" - ], - [ - 1, - "b" - ], - [ - 1, - "a" - ], - [ - 1, - "b" - ], - [ - 1, - "c" - ], - [ - 2, - "a" - ] - ]); + return param[0] - param$1[0] | 0; +})), [ + [ + 1, + "c" + ], + [ + 1, + "b" + ], + [ + 1, + "a" + ], + [ + 1, + "b" + ], + [ + 1, + "c" + ], + [ + 2, + "a" + ] +]); eq("File \"bs_sort_test.res\", line 111, characters 5-12", Belt_SortArray.binarySearchBy([ - 1, - 3, - 5, - 7 - ], 4, Caml.int_compare) ^ -1, 2); + 1, + 3, + 5, + 7 +], 4, Caml.int_compare) ^ -1, 2); eq("File \"bs_sort_test.res\", line 112, characters 5-12", Belt_SortArray.binarySearchBy([ - 1, - 2, - 3, - 4, - 33, - 35, - 36 - ], 33, cmp), 4); + 1, + 2, + 3, + 4, + 33, + 35, + 36 +], 33, cmp), 4); eq("File \"bs_sort_test.res\", line 113, characters 5-12", Belt_SortArray.binarySearchBy([ - 1, - 2, - 3, - 4, - 33, - 35, - 36 - ], 1, cmp), 0); + 1, + 2, + 3, + 4, + 33, + 35, + 36 +], 1, cmp), 0); eq("File \"bs_sort_test.res\", line 114, characters 5-12", Belt_SortArray.binarySearchBy([ - 1, - 2, - 3, - 4, - 33, - 35, - 36 - ], 2, cmp), 1); + 1, + 2, + 3, + 4, + 33, + 35, + 36 +], 2, cmp), 1); eq("File \"bs_sort_test.res\", line 115, characters 5-12", Belt_SortArray.binarySearchBy([ - 1, - 2, - 3, - 4, - 33, - 35, - 36 - ], 3, cmp), 2); + 1, + 2, + 3, + 4, + 33, + 35, + 36 +], 3, cmp), 2); eq("File \"bs_sort_test.res\", line 116, characters 5-12", Belt_SortArray.binarySearchBy([ - 1, - 2, - 3, - 4, - 33, - 35, - 36 - ], 4, cmp), 3); + 1, + 2, + 3, + 4, + 33, + 35, + 36 +], 4, cmp), 3); var aa = Array_data_util.range(0, 1000); b("File \"bs_sort_test.res\", line 118, characters 10-17", Belt_Range.every(0, 1000, (function (i) { - return Belt_SortArray.binarySearchBy(aa, i, cmp) === i; - }))); + return Belt_SortArray.binarySearchBy(aa, i, cmp) === i; +}))); var cc = Belt_Array.map(Array_data_util.range(0, 2000), (function (x) { - return (x << 1); - })); + return (x << 1); +})); eq("File \"bs_sort_test.res\", line 121, characters 5-12", Belt_SortArray.binarySearchBy(cc, 5000, cmp) ^ -1, 2001); @@ -352,8 +352,8 @@ eq("File \"bs_sort_test.res\", line 123, characters 5-12", Belt_SortArray.binary eq("File \"bs_sort_test.res\", line 125, characters 5-12", Belt_SortArray.binarySearchBy(cc, 1, cmp) ^ -1, 1); b("File \"bs_sort_test.res\", line 127, characters 6-13", Belt_Range.every(0, 1999, (function (i) { - return (Belt_SortArray.binarySearchBy(cc, (i << 1) + 1 | 0, cmp) ^ -1) === (i + 1 | 0); - }))); + return (Belt_SortArray.binarySearchBy(cc, (i << 1) + 1 | 0, cmp) ^ -1) === (i + 1 | 0); +}))); function lt(x, y) { return x < y; @@ -364,51 +364,51 @@ eq("File \"bs_sort_test.res\", line 137, characters 5-12", Belt_SortArray.strict eq("File \"bs_sort_test.res\", line 138, characters 5-12", Belt_SortArray.strictlySortedLength([1], lt), 1); eq("File \"bs_sort_test.res\", line 139, characters 5-12", Belt_SortArray.strictlySortedLength([ - 1, - 1 - ], lt), 1); + 1, + 1 +], lt), 1); eq("File \"bs_sort_test.res\", line 140, characters 5-12", Belt_SortArray.strictlySortedLength([ - 1, - 1, - 2 - ], lt), 1); + 1, + 1, + 2 +], lt), 1); eq("File \"bs_sort_test.res\", line 141, characters 5-12", Belt_SortArray.strictlySortedLength([ - 1, - 2 - ], lt), 2); + 1, + 2 +], lt), 2); eq("File \"bs_sort_test.res\", line 142, characters 5-12", Belt_SortArray.strictlySortedLength([ - 1, - 2, - 3, - 4, - 3 - ], lt), 4); + 1, + 2, + 3, + 4, + 3 +], lt), 4); eq("File \"bs_sort_test.res\", line 143, characters 5-12", Belt_SortArray.strictlySortedLength([ - 4, - 4, - 3, - 2, - 1 - ], lt), 1); + 4, + 4, + 3, + 2, + 1 +], lt), 1); eq("File \"bs_sort_test.res\", line 144, characters 5-12", Belt_SortArray.strictlySortedLength([ - 4, - 3, - 2, - 1 - ], lt), -4); + 4, + 3, + 2, + 1 +], lt), -4); eq("File \"bs_sort_test.res\", line 145, characters 5-12", Belt_SortArray.strictlySortedLength([ - 4, - 3, - 2, - 1, - 0 - ], lt), -5); + 4, + 3, + 2, + 1, + 0 +], lt), -5); Mt.from_pair_suites("Bs_sort_test", suites.contents); diff --git a/jscomp/test/bs_stack_test.js b/jscomp/test/bs_stack_test.js index 71b1582de7..e9f0caffd8 100644 --- a/jscomp/test/bs_stack_test.js +++ b/jscomp/test/bs_stack_test.js @@ -64,14 +64,14 @@ function inOrder3(v) { current = v$1.left; }; Belt_MutableStack.dynamicPopIter(s, (function (popped) { - Belt_MutableQueue.add(q, popped.value); - var current = popped.right; - while(current !== undefined) { - var v = current; - Belt_MutableStack.push(s, v); - current = v.left; - }; - })); + Belt_MutableQueue.add(q, popped.value); + var current = popped.right; + while(current !== undefined) { + var v = current; + Belt_MutableStack.push(s, v); + current = v.left; + }; + })); return Belt_MutableQueue.toArray(q); } @@ -126,20 +126,20 @@ var test2 = n(Caml_option.some(n(Caml_option.some(n(Caml_option.some(n(Caml_opti var test3 = n(Caml_option.some(n(Caml_option.some(n(Caml_option.some(n(undefined, undefined, 4)), undefined, 2)), undefined, 5)), Caml_option.some(n(undefined, undefined, 3)), 1); eq("File \"bs_stack_test.res\", line 98, characters 3-10", inOrder(test1), [ - 4, - 2, - 5, - 1, - 3 - ]); + 4, + 2, + 5, + 1, + 3 +]); eq("File \"bs_stack_test.res\", line 99, characters 3-10", inOrder3(test1), [ - 4, - 2, - 5, - 1, - 3 - ]); + 4, + 2, + 5, + 1, + 3 +]); Mt.from_pair_suites("bs_stack_test.res", suites.contents); diff --git a/jscomp/test/bs_string_test.js b/jscomp/test/bs_string_test.js index 5e0c2226f8..f9e0ee90b2 100644 --- a/jscomp/test/bs_string_test.js +++ b/jscomp/test/bs_string_test.js @@ -17,20 +17,20 @@ function eq(loc, x, y) { hd: [ loc + (" id " + String(test_id.contents)), (function (param) { - return { - TAG: "Eq", - _0: x, - _1: y - }; - }) + return { + TAG: "Eq", + _0: x, + _1: y + }; + }) ], tl: suites.contents }; } eq("File \"bs_string_test.res\", line 10, characters 2-9", "ghso ghso g".split(" ").reduce((function (x, y) { - return x + ("-" + y); - }), ""), "-ghso-ghso-g"); + return x + ("-" + y); +}), ""), "-ghso-ghso-g"); Mt.from_pair_suites("Bs_string_test", suites.contents); diff --git a/jscomp/test/bs_unwrap_test.js b/jscomp/test/bs_unwrap_test.js index 328c837471..88e44b139a 100644 --- a/jscomp/test/bs_unwrap_test.js +++ b/jscomp/test/bs_unwrap_test.js @@ -5,9 +5,9 @@ var Curry = require("../../lib/js/curry.js"); var Caml_option = require("../../lib/js/caml_option.js"); console.log([ - "hello world", - 1 - ]); + "hello world", + 1 +]); console.log(1337); @@ -56,26 +56,26 @@ function dyn_log3(prim0, prim1, prim2) { } dyn_log3({ - NAME: "Int", - VAL: 8 - }, { - NAME: "Bool", - VAL: true - }, undefined); + NAME: "Int", + VAL: 8 +}, { + NAME: "Bool", + VAL: true +}, undefined); console.log("foo"); console.log({ - foo: 1 - }); + foo: 1 +}); function dyn_log4(prim) { console.log(prim.VAL); } console.log({ - foo: 2 - }); + foo: 2 +}); function f(x) { console.log(x.VAL); diff --git a/jscomp/test/buffer_test.js b/jscomp/test/buffer_test.js index 21c640ac5f..dd7705f22c 100644 --- a/jscomp/test/buffer_test.js +++ b/jscomp/test/buffer_test.js @@ -12,53 +12,53 @@ var v = "gso"; var suites_0 = [ "equal", (function (param) { + return { + TAG: "Eq", + _0: [ + Caml_bytes.get(Bytes.make(3, /* 'a' */97), 0), + Bytes.make(3, /* 'a' */97)[0] + ], + _1: [ + /* 'a' */97, + /* 'a' */97 + ] + }; + }) +]; + +var suites_1 = { + hd: [ + "equal2", + (function (param) { + var u = Bytes.make(3, /* 'a' */97); + u[0] = /* 'b' */98; return { TAG: "Eq", _0: [ - Caml_bytes.get(Bytes.make(3, /* 'a' */97), 0), - Bytes.make(3, /* 'a' */97)[0] + u[0], + Caml_string.get(v, 0) ], _1: [ - /* 'a' */97, - /* 'a' */97 + /* 'b' */98, + /* 'g' */103 ] }; }) -]; - -var suites_1 = { - hd: [ - "equal2", - (function (param) { - var u = Bytes.make(3, /* 'a' */97); - u[0] = /* 'b' */98; - return { - TAG: "Eq", - _0: [ - u[0], - Caml_string.get(v, 0) - ], - _1: [ - /* 'b' */98, - /* 'g' */103 - ] - }; - }) ], tl: { hd: [ "buffer", (function (param) { - var v = $$Buffer.create(30); - for(var i = 0; i <= 10; ++i){ - $$Buffer.add_string(v, String(i)); - } - return { - TAG: "Eq", - _0: $$Buffer.contents(v), - _1: "012345678910" - }; - }) + var v = $$Buffer.create(30); + for(var i = 0; i <= 10; ++i){ + $$Buffer.add_string(v, String(i)); + } + return { + TAG: "Eq", + _0: $$Buffer.contents(v), + _1: "012345678910" + }; + }) ], tl: /* [] */0 } diff --git a/jscomp/test/bytes_split_gpr_743_test.js b/jscomp/test/bytes_split_gpr_743_test.js index 278f2792dc..520d8142f2 100644 --- a/jscomp/test/bytes_split_gpr_743_test.js +++ b/jscomp/test/bytes_split_gpr_743_test.js @@ -21,12 +21,12 @@ function eq(loc, param) { hd: [ loc + (" id " + String(test_id.contents)), (function (param) { - return { - TAG: "Eq", - _0: x, - _1: y - }; - }) + return { + TAG: "Eq", + _0: x, + _1: y + }; + }) ], tl: suites.contents }; @@ -51,9 +51,9 @@ var res = Bytes.unsafe_to_string(b); console.log(res); eq("File \"bytes_split_gpr_743_test.res\", line 17, characters 5-12", [ - "aab", - res - ]); + "aab", + res +]); var b$1 = [ 0, @@ -74,9 +74,9 @@ var res2 = Bytes.unsafe_to_string(b$1); console.log(res2); eq("File \"bytes_split_gpr_743_test.res\", line 32, characters 5-12", [ - "bcc", - res2 - ]); + "bcc", + res2 +]); Mt.from_pair_suites("Bytes_split_gpr_743_test", suites.contents); diff --git a/jscomp/test/caml_compare_bigint_test.js b/jscomp/test/caml_compare_bigint_test.js index 598914e697..ffbb87e527 100644 --- a/jscomp/test/caml_compare_bigint_test.js +++ b/jscomp/test/caml_compare_bigint_test.js @@ -10,199 +10,199 @@ function isLessThan(title, small, big) { hd: [ "compare: " + title, (function (param) { - return { - TAG: "Eq", - _0: true, - _1: Caml_obj.compare(big, small) > 0 - }; - }) + return { + TAG: "Eq", + _0: true, + _1: Caml_obj.compare(big, small) > 0 + }; + }) ], tl: { hd: [ "compare: " + title, (function (param) { - return { - TAG: "Eq", - _0: true, - _1: Caml_obj.compare(small, big) < 0 - }; - }) + return { + TAG: "Eq", + _0: true, + _1: Caml_obj.compare(small, big) < 0 + }; + }) ], tl: { hd: [ "< operator: " + title, (function (param) { - return { - TAG: "Eq", - _0: true, - _1: Caml_obj.lessthan(small, big) - }; - }) + return { + TAG: "Eq", + _0: true, + _1: Caml_obj.lessthan(small, big) + }; + }) ], tl: { hd: [ "<= operator: " + title, (function (param) { - return { - TAG: "Eq", - _0: true, - _1: Caml_obj.lessequal(small, big) - }; - }) + return { + TAG: "Eq", + _0: true, + _1: Caml_obj.lessequal(small, big) + }; + }) ], tl: { hd: [ "> operator: " + title, (function (param) { - return { - TAG: "Eq", - _0: true, - _1: Caml_obj.greaterthan(big, small) - }; - }) + return { + TAG: "Eq", + _0: true, + _1: Caml_obj.greaterthan(big, small) + }; + }) ], tl: { hd: [ ">= operator: " + title, (function (param) { - return { - TAG: "Eq", - _0: true, - _1: Caml_obj.greaterequal(big, small) - }; - }) + return { + TAG: "Eq", + _0: true, + _1: Caml_obj.greaterequal(big, small) + }; + }) ], tl: { hd: [ "min: " + title, (function (param) { - return { - TAG: "Eq", - _0: small, - _1: Caml_obj.min(big, small) - }; - }) + return { + TAG: "Eq", + _0: small, + _1: Caml_obj.min(big, small) + }; + }) ], tl: { hd: [ "min: " + title, (function (param) { - return { - TAG: "Eq", - _0: small, - _1: Caml_obj.min(small, big) - }; - }) + return { + TAG: "Eq", + _0: small, + _1: Caml_obj.min(small, big) + }; + }) ], tl: { hd: [ "max: " + title, (function (param) { - return { - TAG: "Eq", - _0: big, - _1: Caml_obj.max(big, small) - }; - }) + return { + TAG: "Eq", + _0: big, + _1: Caml_obj.max(big, small) + }; + }) ], tl: { hd: [ "max: " + title, (function (param) { - return { - TAG: "Eq", - _0: big, - _1: Caml_obj.max(small, big) - }; - }) + return { + TAG: "Eq", + _0: big, + _1: Caml_obj.max(small, big) + }; + }) ], tl: { hd: [ "!== operator: " + title, (function (param) { - return { - TAG: "Eq", - _0: true, - _1: big !== small - }; - }) + return { + TAG: "Eq", + _0: true, + _1: big !== small + }; + }) ], tl: { hd: [ "!== operator: " + title, (function (param) { - return { - TAG: "Eq", - _0: true, - _1: small !== big - }; - }) + return { + TAG: "Eq", + _0: true, + _1: small !== big + }; + }) ], tl: { hd: [ "!= operator: " + title, (function (param) { - return { - TAG: "Eq", - _0: true, - _1: Caml_obj.notequal(big, small) - }; - }) + return { + TAG: "Eq", + _0: true, + _1: Caml_obj.notequal(big, small) + }; + }) ], tl: { hd: [ "!= operator: " + title, (function (param) { - return { - TAG: "Eq", - _0: true, - _1: Caml_obj.notequal(small, big) - }; - }) + return { + TAG: "Eq", + _0: true, + _1: Caml_obj.notequal(small, big) + }; + }) ], tl: { hd: [ "== operator: " + title, (function (param) { - return { - TAG: "Eq", - _0: false, - _1: Caml_obj.equal(big, small) - }; - }) + return { + TAG: "Eq", + _0: false, + _1: Caml_obj.equal(big, small) + }; + }) ], tl: { hd: [ "== operator: " + title, (function (param) { - return { - TAG: "Eq", - _0: false, - _1: Caml_obj.equal(small, big) - }; - }) + return { + TAG: "Eq", + _0: false, + _1: Caml_obj.equal(small, big) + }; + }) ], tl: { hd: [ "=== operator: " + title, (function (param) { - return { - TAG: "Eq", - _0: false, - _1: big === small - }; - }) + return { + TAG: "Eq", + _0: false, + _1: big === small + }; + }) ], tl: { hd: [ "=== operator: " + title, (function (param) { - return { - TAG: "Eq", - _0: false, - _1: small === big - }; - }) + return { + TAG: "Eq", + _0: false, + _1: small === big + }; + }) ], tl: /* [] */0 } @@ -230,177 +230,177 @@ function isEqual(title, num1, num2) { hd: [ "< operator: " + title, (function (param) { - return { - TAG: "Eq", - _0: false, - _1: Caml_obj.lessthan(num2, num1) - }; - }) + return { + TAG: "Eq", + _0: false, + _1: Caml_obj.lessthan(num2, num1) + }; + }) ], tl: { hd: [ "<= operator: " + title, (function (param) { - return { - TAG: "Eq", - _0: true, - _1: Caml_obj.lessequal(num2, num1) - }; - }) + return { + TAG: "Eq", + _0: true, + _1: Caml_obj.lessequal(num2, num1) + }; + }) ], tl: { hd: [ "> operator: " + title, (function (param) { - return { - TAG: "Eq", - _0: false, - _1: Caml_obj.greaterthan(num1, num2) - }; - }) + return { + TAG: "Eq", + _0: false, + _1: Caml_obj.greaterthan(num1, num2) + }; + }) ], tl: { hd: [ ">= operator: " + title, (function (param) { - return { - TAG: "Eq", - _0: true, - _1: Caml_obj.greaterequal(num1, num2) - }; - }) + return { + TAG: "Eq", + _0: true, + _1: Caml_obj.greaterequal(num1, num2) + }; + }) ], tl: { hd: [ "min: " + title, (function (param) { - return { - TAG: "Eq", - _0: num1, - _1: Caml_obj.min(num1, num2) - }; - }) + return { + TAG: "Eq", + _0: num1, + _1: Caml_obj.min(num1, num2) + }; + }) ], tl: { hd: [ "max: " + title, (function (param) { - return { - TAG: "Eq", - _0: num1, - _1: Caml_obj.max(num1, num2) - }; - }) + return { + TAG: "Eq", + _0: num1, + _1: Caml_obj.max(num1, num2) + }; + }) ], tl: { hd: [ "compare: " + title, (function (param) { - return { - TAG: "Eq", - _0: 0, - _1: Caml_obj.compare(num1, num2) - }; - }) + return { + TAG: "Eq", + _0: 0, + _1: Caml_obj.compare(num1, num2) + }; + }) ], tl: { hd: [ "compare: " + title, (function (param) { - return { - TAG: "Eq", - _0: 0, - _1: Caml_obj.compare(num2, num1) - }; - }) + return { + TAG: "Eq", + _0: 0, + _1: Caml_obj.compare(num2, num1) + }; + }) ], tl: { hd: [ "!= operator: " + title, (function (param) { - return { - TAG: "Eq", - _0: false, - _1: num1 !== num2 - }; - }) + return { + TAG: "Eq", + _0: false, + _1: num1 !== num2 + }; + }) ], tl: { hd: [ "!= operator: " + title, (function (param) { - return { - TAG: "Eq", - _0: false, - _1: num2 !== num1 - }; - }) + return { + TAG: "Eq", + _0: false, + _1: num2 !== num1 + }; + }) ], tl: { hd: [ "!= operator: " + title, (function (param) { - return { - TAG: "Eq", - _0: false, - _1: Caml_obj.notequal(num1, num2) - }; - }) + return { + TAG: "Eq", + _0: false, + _1: Caml_obj.notequal(num1, num2) + }; + }) ], tl: { hd: [ "!= operator: " + title, (function (param) { - return { - TAG: "Eq", - _0: false, - _1: Caml_obj.notequal(num2, num1) - }; - }) + return { + TAG: "Eq", + _0: false, + _1: Caml_obj.notequal(num2, num1) + }; + }) ], tl: { hd: [ "== operator: " + title, (function (param) { - return { - TAG: "Eq", - _0: true, - _1: Caml_obj.equal(num1, num2) - }; - }) + return { + TAG: "Eq", + _0: true, + _1: Caml_obj.equal(num1, num2) + }; + }) ], tl: { hd: [ "== operator: " + title, (function (param) { - return { - TAG: "Eq", - _0: true, - _1: Caml_obj.equal(num2, num1) - }; - }) + return { + TAG: "Eq", + _0: true, + _1: Caml_obj.equal(num2, num1) + }; + }) ], tl: { hd: [ "=== operator: " + title, (function (param) { - return { - TAG: "Eq", - _0: true, - _1: num1 === num2 - }; - }) + return { + TAG: "Eq", + _0: true, + _1: num1 === num2 + }; + }) ], tl: { hd: [ "=== operator: " + title, (function (param) { - return { - TAG: "Eq", - _0: true, - _1: num2 === num1 - }; - }) + return { + TAG: "Eq", + _0: true, + _1: num2 === num1 + }; + }) ], tl: /* [] */0 } diff --git a/jscomp/test/caml_compare_test.js b/jscomp/test/caml_compare_test.js index 0ee723edd0..43a2c638b3 100644 --- a/jscomp/test/caml_compare_test.js +++ b/jscomp/test/caml_compare_test.js @@ -9,10 +9,10 @@ var function_equal_test; try { function_equal_test = Caml_obj.equal((function (x) { - return x + 1 | 0; - }), (function (x) { - return x + 2 | 0; - })); + return x + 1 | 0; + }), (function (x) { + return x + 2 | 0; + })); } catch (raw_exn){ var exn = Caml_js_exceptions.internalToOCamlException(raw_exn); @@ -24,232 +24,334 @@ var suites = { hd: [ "File \"caml_compare_test.res\", line 12, characters 5-12", (function (param) { - return { - TAG: "Eq", - _0: true, - _1: Caml_obj.lessthan(undefined, 1) - }; - }) + return { + TAG: "Eq", + _0: true, + _1: Caml_obj.lessthan(undefined, 1) + }; + }) ], tl: { hd: [ "option2", (function (param) { - return { - TAG: "Eq", - _0: true, - _1: Caml_obj.lessthan(1, 2) - }; - }) + return { + TAG: "Eq", + _0: true, + _1: Caml_obj.lessthan(1, 2) + }; + }) ], tl: { hd: [ "File \"caml_compare_test.res\", line 14, characters 5-12", (function (param) { + return { + TAG: "Eq", + _0: true, + _1: Caml_obj.greaterthan({ + hd: 1, + tl: /* [] */0 + }, /* [] */0) + }; + }) + ], + tl: { + hd: [ + "listeq", + (function (param) { return { TAG: "Eq", _0: true, - _1: Caml_obj.greaterthan({ - hd: 1, + _1: Caml_obj.equal({ + hd: 1, + tl: { + hd: 2, + tl: { + hd: 3, tl: /* [] */0 - }, /* [] */0) + } + } + }, { + hd: 1, + tl: { + hd: 2, + tl: { + hd: 3, + tl: /* [] */0 + } + } + }) }; }) - ], - tl: { - hd: [ - "listeq", - (function (param) { - return { - TAG: "Eq", - _0: true, - _1: Caml_obj.equal({ - hd: 1, - tl: { - hd: 2, - tl: { - hd: 3, - tl: /* [] */0 - } - } - }, { - hd: 1, - tl: { - hd: 2, - tl: { - hd: 3, - tl: /* [] */0 - } - } - }) - }; - }) ], tl: { hd: [ "listneq", (function (param) { - return { - TAG: "Eq", - _0: true, - _1: Caml_obj.greaterthan({ - hd: 1, - tl: { - hd: 2, - tl: { - hd: 3, - tl: /* [] */0 - } - } - }, { - hd: 1, - tl: { - hd: 2, - tl: { - hd: 2, - tl: /* [] */0 - } - } - }) - }; - }) + return { + TAG: "Eq", + _0: true, + _1: Caml_obj.greaterthan({ + hd: 1, + tl: { + hd: 2, + tl: { + hd: 3, + tl: /* [] */0 + } + } + }, { + hd: 1, + tl: { + hd: 2, + tl: { + hd: 2, + tl: /* [] */0 + } + } + }) + }; + }) ], tl: { hd: [ "custom_u", (function (param) { - return { - TAG: "Eq", - _0: true, - _1: Caml_obj.greaterthan([ - { - TAG: "A", - _0: 3 - }, - { - TAG: "B", - _0: 2, - _1: false - }, - { - TAG: "C", - _0: 1 - } - ], [ - { - TAG: "A", - _0: 3 - }, - { - TAG: "B", - _0: 2, - _1: false - }, - { - TAG: "C", - _0: 0 - } - ]) - }; - }) + return { + TAG: "Eq", + _0: true, + _1: Caml_obj.greaterthan([ + { + TAG: "A", + _0: 3 + }, + { + TAG: "B", + _0: 2, + _1: false + }, + { + TAG: "C", + _0: 1 + } + ], [ + { + TAG: "A", + _0: 3 + }, + { + TAG: "B", + _0: 2, + _1: false + }, + { + TAG: "C", + _0: 0 + } + ]) + }; + }) ], tl: { hd: [ "custom_u2", (function (param) { - return { - TAG: "Eq", - _0: true, - _1: Caml_obj.equal([ - { - TAG: "A", - _0: 3 - }, - { - TAG: "B", - _0: 2, - _1: false - }, - { - TAG: "C", - _0: 1 - } - ], [ - { - TAG: "A", - _0: 3 - }, - { - TAG: "B", - _0: 2, - _1: false - }, - { - TAG: "C", - _0: 1 - } - ]) - }; - }) + return { + TAG: "Eq", + _0: true, + _1: Caml_obj.equal([ + { + TAG: "A", + _0: 3 + }, + { + TAG: "B", + _0: 2, + _1: false + }, + { + TAG: "C", + _0: 1 + } + ], [ + { + TAG: "A", + _0: 3 + }, + { + TAG: "B", + _0: 2, + _1: false + }, + { + TAG: "C", + _0: 1 + } + ]) + }; + }) ], tl: { hd: [ "function", (function (param) { - return { - TAG: "Eq", - _0: true, - _1: function_equal_test - }; - }) + return { + TAG: "Eq", + _0: true, + _1: function_equal_test + }; + }) ], tl: { hd: [ "File \"caml_compare_test.res\", line 20, characters 5-12", (function (param) { - return { - TAG: "Eq", - _0: true, - _1: Caml_obj.lessthan(undefined, 1) - }; - }) + return { + TAG: "Eq", + _0: true, + _1: Caml_obj.lessthan(undefined, 1) + }; + }) ], tl: { hd: [ "File \"caml_compare_test.res\", line 21, characters 5-12", (function (param) { - return { - TAG: "Eq", - _0: true, - _1: Caml_obj.lessthan(undefined, [ - 1, - 30 - ]) - }; - }) + return { + TAG: "Eq", + _0: true, + _1: Caml_obj.lessthan(undefined, [ + 1, + 30 + ]) + }; + }) ], tl: { hd: [ "File \"caml_compare_test.res\", line 22, characters 5-12", (function (param) { - return { - TAG: "Eq", - _0: true, - _1: Caml_obj.greaterthan([ - 1, - 30 - ], undefined) - }; - }) + return { + TAG: "Eq", + _0: true, + _1: Caml_obj.greaterthan([ + 1, + 30 + ], undefined) + }; + }) ], tl: { hd: [ "File \"caml_compare_test.res\", line 24, characters 6-13", (function (param) { + return { + TAG: "Eq", + _0: true, + _1: Caml_obj.lessthan({ + hd: 2, + tl: { + hd: 6, + tl: { + hd: 1, + tl: { + hd: 1, + tl: { + hd: 2, + tl: { + hd: 1, + tl: { + hd: 4, + tl: { + hd: 2, + tl: { + hd: 1, + tl: /* [] */0 + } + } + } + } + } + } + } + } + }, { + hd: 2, + tl: { + hd: 6, + tl: { + hd: 1, + tl: { + hd: 1, + tl: { + hd: 2, + tl: { + hd: 1, + tl: { + hd: 4, + tl: { + hd: 2, + tl: { + hd: 1, + tl: { + hd: 409, + tl: /* [] */0 + } + } + } + } + } + } + } + } + } + }) + }; + }) + ], + tl: { + hd: [ + "File \"caml_compare_test.res\", line 27, characters 5-12", + (function (param) { return { TAG: "Eq", _0: true, _1: Caml_obj.lessthan({ + hd: 1, + tl: /* [] */0 + }, { + hd: 1, + tl: { + hd: 409, + tl: /* [] */0 + } + }) + }; + }) + ], + tl: { + hd: [ + "File \"caml_compare_test.res\", line 28, characters 5-12", + (function (param) { + return { + TAG: "Eq", + _0: true, + _1: Caml_obj.lessthan(/* [] */0, { + hd: 409, + tl: /* [] */0 + }) + }; + }) + ], + tl: { + hd: [ + "File \"caml_compare_test.res\", line 30, characters 6-13", + (function (param) { + return { + TAG: "Eq", + _0: true, + _1: Caml_obj.greaterthan({ hd: 2, tl: { hd: 6, @@ -267,7 +369,10 @@ var suites = { hd: 2, tl: { hd: 1, - tl: /* [] */0 + tl: { + hd: 409, + tl: /* [] */0 + } } } } @@ -294,10 +399,7 @@ var suites = { hd: 2, tl: { hd: 1, - tl: { - hd: 409, - tl: /* [] */0 - } + tl: /* [] */0 } } } @@ -307,51 +409,39 @@ var suites = { } } }) - }; - }) - ], - tl: { - hd: [ - "File \"caml_compare_test.res\", line 27, characters 5-12", - (function (param) { - return { - TAG: "Eq", - _0: true, - _1: Caml_obj.lessthan({ - hd: 1, - tl: /* [] */0 - }, { - hd: 1, - tl: { - hd: 409, - tl: /* [] */0 - } - }) - }; - }) - ], - tl: { - hd: [ - "File \"caml_compare_test.res\", line 28, characters 5-12", - (function (param) { - return { - TAG: "Eq", - _0: true, - _1: Caml_obj.lessthan(/* [] */0, { - hd: 409, - tl: /* [] */0 - }) }; }) - ], - tl: { - hd: [ - "File \"caml_compare_test.res\", line 30, characters 6-13", - (function (param) { + ], + tl: { + hd: [ + "File \"caml_compare_test.res\", line 33, characters 5-12", + (function (param) { return { TAG: "Eq", - _0: true, - _1: Caml_obj.greaterthan({ + _0: false, + _1: false + }; + }) + ], + tl: { + hd: [ + "File \"caml_compare_test.res\", line 34, characters 5-12", + (function (param) { + return { + TAG: "Eq", + _0: false, + _1: false + }; + }) + ], + tl: { + hd: [ + "File \"caml_compare_test.res\", line 36, characters 6-13", + (function (param) { + return { + TAG: "Eq", + _0: false, + _1: Caml_obj.equal({ hd: 2, tl: { hd: 6, @@ -369,10 +459,7 @@ var suites = { hd: 2, tl: { hd: 1, - tl: { - hd: 409, - tl: /* [] */0 - } + tl: /* [] */0 } } } @@ -399,7 +486,10 @@ var suites = { hd: 2, tl: { hd: 1, - tl: /* [] */0 + tl: { + hd: 409, + tl: /* [] */0 + } } } } @@ -409,58 +499,37 @@ var suites = { } } }) - }; - }) - ], - tl: { - hd: [ - "File \"caml_compare_test.res\", line 33, characters 5-12", - (function (param) { - return { - TAG: "Eq", - _0: false, - _1: false - }; - }) - ], - tl: { - hd: [ - "File \"caml_compare_test.res\", line 34, characters 5-12", - (function (param) { - return { - TAG: "Eq", - _0: false, - _1: false }; }) - ], - tl: { - hd: [ - "File \"caml_compare_test.res\", line 36, characters 6-13", - (function (param) { + ], + tl: { + hd: [ + "File \"caml_compare_test.res\", line 40, characters 6-13", + (function (param) { return { TAG: "Eq", _0: false, _1: Caml_obj.equal({ - hd: 2, + hd: 2, + tl: { + hd: 6, + tl: { + hd: 1, tl: { - hd: 6, + hd: 1, tl: { - hd: 1, + hd: 2, tl: { hd: 1, tl: { - hd: 2, + hd: 4, tl: { - hd: 1, + hd: 2, tl: { - hd: 4, + hd: 1, tl: { - hd: 2, - tl: { - hd: 1, - tl: /* [] */0 - } + hd: 409, + tl: /* [] */0 } } } @@ -468,606 +537,537 @@ var suites = { } } } - }, { - hd: 2, + } + } + }, { + hd: 2, + tl: { + hd: 6, + tl: { + hd: 1, tl: { - hd: 6, + hd: 1, tl: { - hd: 1, + hd: 2, tl: { hd: 1, tl: { - hd: 2, + hd: 4, tl: { - hd: 1, + hd: 2, tl: { - hd: 4, - tl: { - hd: 2, - tl: { - hd: 1, - tl: { - hd: 409, - tl: /* [] */0 - } - } - } + hd: 1, + tl: /* [] */0 } } } } } } - }) + } + } + }) }; }) - ], - tl: { - hd: [ - "File \"caml_compare_test.res\", line 40, characters 6-13", - (function (param) { - return { - TAG: "Eq", - _0: false, - _1: Caml_obj.equal({ - hd: 2, - tl: { - hd: 6, - tl: { - hd: 1, - tl: { - hd: 1, - tl: { - hd: 2, - tl: { - hd: 1, - tl: { - hd: 4, - tl: { - hd: 2, - tl: { - hd: 1, - tl: { - hd: 409, - tl: /* [] */0 - } - } - } - } - } - } - } - } - } - }, { - hd: 2, - tl: { - hd: 6, - tl: { - hd: 1, - tl: { - hd: 1, - tl: { - hd: 2, - tl: { - hd: 1, - tl: { - hd: 4, - tl: { - hd: 2, - tl: { - hd: 1, - tl: /* [] */0 - } - } - } - } - } - } - } - } - }) - }; - }) ], tl: { hd: [ "cmp_id", (function (param) { - return { - TAG: "Eq", - _0: Caml_obj.compare({ - x: 1, - y: 2 - }, { - x: 1, - y: 2 - }), - _1: 0 - }; - }) + return { + TAG: "Eq", + _0: Caml_obj.compare({ + x: 1, + y: 2 + }, { + x: 1, + y: 2 + }), + _1: 0 + }; + }) ], tl: { hd: [ "cmp_val", (function (param) { - return { - TAG: "Eq", - _0: Caml_obj.compare({ - x: 1 - }, { - x: 2 - }), - _1: -1 - }; - }) + return { + TAG: "Eq", + _0: Caml_obj.compare({ + x: 1 + }, { + x: 2 + }), + _1: -1 + }; + }) ], tl: { hd: [ "cmp_val2", (function (param) { - return { - TAG: "Eq", - _0: Caml_obj.compare({ - x: 2 - }, { - x: 1 - }), - _1: 1 - }; - }) + return { + TAG: "Eq", + _0: Caml_obj.compare({ + x: 2 + }, { + x: 1 + }), + _1: 1 + }; + }) ], tl: { hd: [ "cmp_empty", (function (param) { - return { - TAG: "Eq", - _0: Caml_obj.compare({}, {}), - _1: 0 - }; - }) + return { + TAG: "Eq", + _0: Caml_obj.compare({}, {}), + _1: 0 + }; + }) ], tl: { hd: [ "cmp_empty2", (function (param) { - return { - TAG: "Eq", - _0: Caml_obj.compare({}, {x:1}), - _1: -1 - }; - }) + return { + TAG: "Eq", + _0: Caml_obj.compare({}, {x:1}), + _1: -1 + }; + }) ], tl: { hd: [ "cmp_swap", (function (param) { - return { - TAG: "Eq", - _0: Caml_obj.compare({ - x: 1, - y: 2 - }, { - y: 2, - x: 1 - }), - _1: 0 - }; - }) + return { + TAG: "Eq", + _0: Caml_obj.compare({ + x: 1, + y: 2 + }, { + y: 2, + x: 1 + }), + _1: 0 + }; + }) ], tl: { hd: [ "cmp_size", (function (param) { - return { - TAG: "Eq", - _0: Caml_obj.compare({x:1}, {x:1, y:2}), - _1: -1 - }; - }) + return { + TAG: "Eq", + _0: Caml_obj.compare({x:1}, {x:1, y:2}), + _1: -1 + }; + }) ], tl: { hd: [ "cmp_size2", (function (param) { - return { - TAG: "Eq", - _0: Caml_obj.compare({x:1, y:2}, {x:1}), - _1: 1 - }; - }) + return { + TAG: "Eq", + _0: Caml_obj.compare({x:1, y:2}, {x:1}), + _1: 1 + }; + }) ], tl: { hd: [ "cmp_order", (function (param) { - return { - TAG: "Eq", - _0: Caml_obj.compare({ - x: 0, - y: 1 - }, { - x: 1, - y: 0 - }), - _1: -1 - }; - }) + return { + TAG: "Eq", + _0: Caml_obj.compare({ + x: 0, + y: 1 + }, { + x: 1, + y: 0 + }), + _1: -1 + }; + }) ], tl: { hd: [ "cmp_order2", (function (param) { - return { - TAG: "Eq", - _0: Caml_obj.compare({ - x: 1, - y: 0 - }, { - x: 0, - y: 1 - }), - _1: 1 - }; - }) + return { + TAG: "Eq", + _0: Caml_obj.compare({ + x: 1, + y: 0 + }, { + x: 0, + y: 1 + }), + _1: 1 + }; + }) ], tl: { hd: [ "cmp_in_list", (function (param) { - return { - TAG: "Eq", - _0: Caml_obj.compare({ - hd: { - x: 1 - }, - tl: /* [] */0 - }, { - hd: { - x: 2 - }, - tl: /* [] */0 - }), - _1: -1 - }; - }) + return { + TAG: "Eq", + _0: Caml_obj.compare({ + hd: { + x: 1 + }, + tl: /* [] */0 + }, { + hd: { + x: 2 + }, + tl: /* [] */0 + }), + _1: -1 + }; + }) ], tl: { hd: [ "cmp_in_list2", (function (param) { - return { - TAG: "Eq", - _0: Caml_obj.compare({ - hd: { - x: 2 - }, - tl: /* [] */0 - }, { - hd: { - x: 1 - }, - tl: /* [] */0 - }), - _1: 1 - }; - }) + return { + TAG: "Eq", + _0: Caml_obj.compare({ + hd: { + x: 2 + }, + tl: /* [] */0 + }, { + hd: { + x: 1 + }, + tl: /* [] */0 + }), + _1: 1 + }; + }) ], tl: { hd: [ "cmp_with_list", (function (param) { - return { - TAG: "Eq", - _0: Caml_obj.compare({ - x: { - hd: 0, - tl: /* [] */0 - } - }, { - x: { - hd: 1, - tl: /* [] */0 - } - }), - _1: -1 - }; - }) + return { + TAG: "Eq", + _0: Caml_obj.compare({ + x: { + hd: 0, + tl: /* [] */0 + } + }, { + x: { + hd: 1, + tl: /* [] */0 + } + }), + _1: -1 + }; + }) ], tl: { hd: [ "cmp_with_list2", (function (param) { - return { - TAG: "Eq", - _0: Caml_obj.compare({ - x: { - hd: 1, - tl: /* [] */0 - } - }, { - x: { - hd: 0, - tl: /* [] */0 - } - }), - _1: 1 - }; - }) + return { + TAG: "Eq", + _0: Caml_obj.compare({ + x: { + hd: 1, + tl: /* [] */0 + } + }, { + x: { + hd: 0, + tl: /* [] */0 + } + }), + _1: 1 + }; + }) ], tl: { hd: [ "eq_id", (function (param) { - return { - TAG: "Ok", - _0: Caml_obj.equal({ - x: 1, - y: 2 - }, { - x: 1, - y: 2 - }) - }; - }) + return { + TAG: "Ok", + _0: Caml_obj.equal({ + x: 1, + y: 2 + }, { + x: 1, + y: 2 + }) + }; + }) ], tl: { hd: [ "eq_val", (function (param) { + return { + TAG: "Eq", + _0: Caml_obj.equal({ + x: 1 + }, { + x: 2 + }), + _1: false + }; + }) + ], + tl: { + hd: [ + "eq_val2", + (function (param) { return { TAG: "Eq", _0: Caml_obj.equal({ - x: 1 - }, { - x: 2 - }), + x: 2 + }, { + x: 1 + }), _1: false }; }) - ], - tl: { - hd: [ - "eq_val2", - (function (param) { - return { - TAG: "Eq", - _0: Caml_obj.equal({ - x: 2 - }, { - x: 1 - }), - _1: false - }; - }) ], tl: { hd: [ "eq_empty", (function (param) { - return { - TAG: "Eq", - _0: Caml_obj.equal({}, {}), - _1: true - }; - }) + return { + TAG: "Eq", + _0: Caml_obj.equal({}, {}), + _1: true + }; + }) ], tl: { hd: [ "eq_empty2", (function (param) { - return { - TAG: "Eq", - _0: Caml_obj.equal({}, {x:1}), - _1: false - }; - }) + return { + TAG: "Eq", + _0: Caml_obj.equal({}, {x:1}), + _1: false + }; + }) ], tl: { hd: [ "eq_swap", (function (param) { - return { - TAG: "Ok", - _0: Caml_obj.equal({ - x: 1, - y: 2 - }, { - y: 2, - x: 1 - }) - }; - }) + return { + TAG: "Ok", + _0: Caml_obj.equal({ + x: 1, + y: 2 + }, { + y: 2, + x: 1 + }) + }; + }) ], tl: { hd: [ "eq_size", (function (param) { - return { - TAG: "Eq", - _0: Caml_obj.equal({x:1}, {x:1, y:2}), - _1: false - }; - }) + return { + TAG: "Eq", + _0: Caml_obj.equal({x:1}, {x:1, y:2}), + _1: false + }; + }) ], tl: { hd: [ "eq_size2", (function (param) { - return { - TAG: "Eq", - _0: Caml_obj.equal({x:1, y:2}, {x:1}), - _1: false - }; - }) + return { + TAG: "Eq", + _0: Caml_obj.equal({x:1, y:2}, {x:1}), + _1: false + }; + }) ], tl: { hd: [ "eq_in_list", (function (param) { - return { - TAG: "Eq", - _0: Caml_obj.equal({ - hd: { - x: 1 - }, - tl: /* [] */0 - }, { - hd: { - x: 2 - }, - tl: /* [] */0 - }), - _1: false - }; - }) + return { + TAG: "Eq", + _0: Caml_obj.equal({ + hd: { + x: 1 + }, + tl: /* [] */0 + }, { + hd: { + x: 2 + }, + tl: /* [] */0 + }), + _1: false + }; + }) ], tl: { hd: [ "eq_in_list2", (function (param) { + return { + TAG: "Eq", + _0: Caml_obj.equal({ + hd: { + x: 2 + }, + tl: /* [] */0 + }, { + hd: { + x: 2 + }, + tl: /* [] */0 + }), + _1: true + }; + }) + ], + tl: { + hd: [ + "eq_with_list", + (function (param) { return { TAG: "Eq", _0: Caml_obj.equal({ - hd: { - x: 2 - }, - tl: /* [] */0 - }, { - hd: { - x: 2 - }, - tl: /* [] */0 - }), + x: { + hd: 0, + tl: /* [] */0 + } + }, { + x: { + hd: 0, + tl: /* [] */0 + } + }), _1: true }; }) - ], - tl: { - hd: [ - "eq_with_list", - (function (param) { - return { - TAG: "Eq", - _0: Caml_obj.equal({ - x: { - hd: 0, - tl: /* [] */0 - } - }, { - x: { - hd: 0, - tl: /* [] */0 - } - }), - _1: true - }; - }) ], tl: { hd: [ "eq_with_list2", (function (param) { - return { - TAG: "Eq", - _0: Caml_obj.equal({ - x: { - hd: 0, - tl: /* [] */0 - } - }, { - x: { - hd: 1, - tl: /* [] */0 - } - }), - _1: false - }; - }) + return { + TAG: "Eq", + _0: Caml_obj.equal({ + x: { + hd: 0, + tl: /* [] */0 + } + }, { + x: { + hd: 1, + tl: /* [] */0 + } + }), + _1: false + }; + }) ], tl: { hd: [ "eq_no_prototype", (function (param) { - return { - TAG: "Eq", - _0: Caml_obj.equal({x:1}, ((function(){let o = Object.create(null);o.x = 1;return o;})())), - _1: true - }; - }) + return { + TAG: "Eq", + _0: Caml_obj.equal({x:1}, ((function(){let o = Object.create(null);o.x = 1;return o;})())), + _1: true + }; + }) ], tl: { hd: [ "File \"caml_compare_test.res\", line 76, characters 5-12", (function (param) { - return { - TAG: "Eq", - _0: Caml_obj.compare(null, { - hd: 3, - tl: /* [] */0 - }), - _1: -1 - }; - }) + return { + TAG: "Eq", + _0: Caml_obj.compare(null, { + hd: 3, + tl: /* [] */0 + }), + _1: -1 + }; + }) ], tl: { hd: [ "File \"caml_compare_test.res\", line 77, characters 5-12", (function (param) { - return { - TAG: "Eq", - _0: Caml_obj.compare({ - hd: 3, - tl: /* [] */0 - }, null), - _1: 1 - }; - }) + return { + TAG: "Eq", + _0: Caml_obj.compare({ + hd: 3, + tl: /* [] */0 + }, null), + _1: 1 + }; + }) ], tl: { hd: [ "File \"caml_compare_test.res\", line 78, characters 5-12", (function (param) { - return { - TAG: "Eq", - _0: Caml_obj.compare(null, 0), - _1: -1 - }; - }) + return { + TAG: "Eq", + _0: Caml_obj.compare(null, 0), + _1: -1 + }; + }) ], tl: { hd: [ "File \"caml_compare_test.res\", line 79, characters 5-12", (function (param) { - return { - TAG: "Eq", - _0: Caml_obj.compare(0, null), - _1: 1 - }; - }) + return { + TAG: "Eq", + _0: Caml_obj.compare(0, null), + _1: 1 + }; + }) ], tl: { hd: [ "File \"caml_compare_test.res\", line 80, characters 5-12", (function (param) { - return { - TAG: "Eq", - _0: Caml_obj.compare(undefined, 0), - _1: -1 - }; - }) + return { + TAG: "Eq", + _0: Caml_obj.compare(undefined, 0), + _1: -1 + }; + }) ], tl: { hd: [ "File \"caml_compare_test.res\", line 81, characters 5-12", (function (param) { - return { - TAG: "Eq", - _0: Caml_obj.compare(0, undefined), - _1: 1 - }; - }) + return { + TAG: "Eq", + _0: Caml_obj.compare(0, undefined), + _1: 1 + }; + }) ], tl: /* [] */0 } @@ -1135,21 +1135,21 @@ function eq(loc, x, y) { eq("File \"caml_compare_test.res\", line 88, characters 3-10", true, Caml_obj.greaterthan(1, undefined)); eq("File \"caml_compare_test.res\", line 89, characters 3-10", true, Caml_obj.lessthan(/* [] */0, { - hd: 1, - tl: /* [] */0 - })); + hd: 1, + tl: /* [] */0 +})); eq("File \"caml_compare_test.res\", line 90, characters 3-10", false, Caml_obj.greaterthan(undefined, 1)); eq("File \"caml_compare_test.res\", line 91, characters 3-10", false, Caml_obj.greaterthan(undefined, [ - 1, - 30 - ])); + 1, + 30 +])); eq("File \"caml_compare_test.res\", line 92, characters 3-10", false, Caml_obj.lessthan([ - 1, - 30 - ], undefined)); + 1, + 30 +], undefined)); Mt.from_pair_suites("Caml_compare_test", suites.contents); diff --git a/jscomp/test/caml_format_test.js b/jscomp/test/caml_format_test.js index 1668aef977..ce1fce3b8c 100644 --- a/jscomp/test/caml_format_test.js +++ b/jscomp/test/caml_format_test.js @@ -80,25 +80,25 @@ var of_string = [ function from_float_of_string(xs) { return $$Array.mapi((function (i, param) { - return Pervasives.string_of_float; - }), xs); + return Pervasives.string_of_float; + }), xs); } function from_of_string(xs) { return $$Array.to_list($$Array.mapi((function (i, param) { - var b = param[1]; - var a = param[0]; - return [ - "of_string " + String(i), - (function (param) { - return { - TAG: "Eq", - _0: Caml_format.int_of_string(b), - _1: a - }; - }) - ]; - }), of_string)); + var b = param[1]; + var a = param[0]; + return [ + "of_string " + String(i), + (function (param) { + return { + TAG: "Eq", + _0: Caml_format.int_of_string(b), + _1: a + }; + }) + ]; + }), of_string)); } var to_str = Caml_format.int_of_string; @@ -142,69 +142,69 @@ var pairs$1 = [ ]; var suites = Pervasives.$at(from_of_string(of_string), Pervasives.$at({ - hd: [ - "isnan_of_string", - (function (param) { - return { - TAG: "Eq", - _0: true, - _1: Pervasives.classify_float(Caml_format.float_of_string("nan")) === "FP_nan" - }; - }) - ], - tl: /* [] */0 - }, Pervasives.$at($$Array.to_list($$Array.mapi((function (i, param) { - var b = param[1]; - var a = param[0]; - return [ - "infinity_of_string " + String(i), - (function (param) { - return { - TAG: "Eq", - _0: a, - _1: Pervasives.classify_float(Caml_format.float_of_string(b)) - }; - }) - ]; - }), pairs)), Pervasives.$at({ - hd: [ - "throw", - (function (param) { - return { - TAG: "ThrowAny", - _0: (function (param) { - Caml_format.float_of_string(""); - }) - }; - }) - ], - tl: { - hd: [ - "format_int", - (function (param) { - return { - TAG: "Eq", - _0: " 33", - _1: Caml_format.format_int("%32d", 33) - }; - }) - ], - tl: /* [] */0 - } - }, $$Array.to_list($$Array.mapi((function (i, param) { - var b = param[1]; - var a = param[0]; - return [ - "normal_float_of_string " + String(i), - (function (param) { - return { - TAG: "Eq", - _0: a, - _1: Caml_format.float_of_string(b) - }; - }) - ]; - }), pairs$1)))))); + hd: [ + "isnan_of_string", + (function (param) { + return { + TAG: "Eq", + _0: true, + _1: Pervasives.classify_float(Caml_format.float_of_string("nan")) === "FP_nan" + }; + }) + ], + tl: /* [] */0 +}, Pervasives.$at($$Array.to_list($$Array.mapi((function (i, param) { + var b = param[1]; + var a = param[0]; + return [ + "infinity_of_string " + String(i), + (function (param) { + return { + TAG: "Eq", + _0: a, + _1: Pervasives.classify_float(Caml_format.float_of_string(b)) + }; + }) + ]; +}), pairs)), Pervasives.$at({ + hd: [ + "throw", + (function (param) { + return { + TAG: "ThrowAny", + _0: (function (param) { + Caml_format.float_of_string(""); + }) + }; + }) + ], + tl: { + hd: [ + "format_int", + (function (param) { + return { + TAG: "Eq", + _0: " 33", + _1: Caml_format.format_int("%32d", 33) + }; + }) + ], + tl: /* [] */0 + } +}, $$Array.to_list($$Array.mapi((function (i, param) { + var b = param[1]; + var a = param[0]; + return [ + "normal_float_of_string " + String(i), + (function (param) { + return { + TAG: "Eq", + _0: a, + _1: Caml_format.float_of_string(b) + }; + }) + ]; +}), pairs$1)))))); function ff(param) { return Caml_format.format_int("%32d", param); @@ -321,41 +321,41 @@ var float_data = [ var int64_suites_0 = [ "i64_simple7", (function (param) { - return { - TAG: "Eq", - _0: Caml_int64.to_string([ - 0, - 3333 - ]), - _1: "3333" - }; - }) + return { + TAG: "Eq", + _0: Caml_int64.to_string([ + 0, + 3333 + ]), + _1: "3333" + }; + }) ]; var int64_suites_1 = { hd: [ "i64_simple15", (function (param) { - return { - TAG: "Eq", - _0: Caml_int64.to_string(Caml_int64.neg_one), - _1: "-1" - }; - }) + return { + TAG: "Eq", + _0: Caml_int64.to_string(Caml_int64.neg_one), + _1: "-1" + }; + }) ], tl: { hd: [ "i64_simple16", (function (param) { - return { - TAG: "Eq", - _0: Caml_int64.to_string([ - -1, - 4294956185 - ]), - _1: "-11111" - }; - }) + return { + TAG: "Eq", + _0: Caml_int64.to_string([ + -1, + 4294956185 + ]), + _1: "-11111" + }; + }) ], tl: /* [] */0 } @@ -424,33 +424,33 @@ var of_string_data = [ ]; Mt.from_pair_suites("Caml_format_test", Pervasives.$at(suites, Pervasives.$at($$Array.to_list($$Array.mapi((function (i, param) { - var str_result = param[2]; - var f = param[1]; - var fmt = param[0]; - return [ - "loat_format " + String(i), - (function (param) { - return { - TAG: "Eq", - _0: Caml_format.format_float(fmt, f), - _1: str_result - }; - }) - ]; - }), float_data)), Pervasives.$at(int64_suites, $$Array.to_list($$Array.mapi((function (i, param) { - var b = param[1]; - var a = param[0]; - return [ - "int64_of_string " + String(i) + " ", - (function (param) { - return { - TAG: "Eq", - _0: Caml_format.int64_of_string(b), - _1: a - }; - }) - ]; - }), of_string_data)))))); + var str_result = param[2]; + var f = param[1]; + var fmt = param[0]; + return [ + "loat_format " + String(i), + (function (param) { + return { + TAG: "Eq", + _0: Caml_format.format_float(fmt, f), + _1: str_result + }; + }) + ]; +}), float_data)), Pervasives.$at(int64_suites, $$Array.to_list($$Array.mapi((function (i, param) { + var b = param[1]; + var a = param[0]; + return [ + "int64_of_string " + String(i) + " ", + (function (param) { + return { + TAG: "Eq", + _0: Caml_format.int64_of_string(b), + _1: a + }; + }) + ]; +}), of_string_data)))))); var float_suites = { hd: "float_nan", diff --git a/jscomp/test/chain_code_test.js b/jscomp/test/chain_code_test.js index 6426eff2c5..e5524db491 100644 --- a/jscomp/test/chain_code_test.js +++ b/jscomp/test/chain_code_test.js @@ -18,12 +18,12 @@ function eq(loc, x, y) { hd: [ loc + (" id " + String(test_id.contents)), (function (param) { - return { - TAG: "Eq", - _0: x, - _1: y - }; - }) + return { + TAG: "Eq", + _0: x, + _1: y + }; + }) ], tl: suites.contents }; @@ -53,12 +53,12 @@ function f4(h, x, y) { } eq("File \"chain_code_test.res\", line 24, characters 12-19", 32, ({ - x: { - y: { - z: 32 - } - } - }).x.y.z); + x: { + y: { + z: 32 + } + } +}).x.y.z); Mt.from_pair_suites("Chain_code_test", suites.contents); diff --git a/jscomp/test/chn_test.js b/jscomp/test/chn_test.js index 8ba5ca93f9..cb8977688b 100644 --- a/jscomp/test/chn_test.js +++ b/jscomp/test/chn_test.js @@ -19,12 +19,12 @@ function eq(loc, x, y) { hd: [ loc + (" id " + String(test_id.contents)), (function (param) { - return { - TAG: "Eq", - _0: x, - _1: y - }; - }) + return { + TAG: "Eq", + _0: x, + _1: y + }; + }) ], tl: suites.contents }; @@ -36,65 +36,63 @@ console.log("\x3f\u003f\b\t\n\v\f\r\0\"'"); function convert(s) { return $$Array.to_list(Array.from(s, (function (x) { - var x$1 = x.codePointAt(0); - if (x$1 !== undefined) { - return x$1; - } - throw { - RE_EXN_ID: "Assert_failure", - _1: [ - "chn_test.res", - 17, - 14 - ], - Error: new Error() - }; - }))); + var x$1 = x.codePointAt(0); + if (x$1 !== undefined) { + return x$1; + } + throw { + RE_EXN_ID: "Assert_failure", + _1: [ + "chn_test.res", + 17, + 14 + ], + Error: new Error() + }; + }))); } eq("File \"chn_test.res\", line 24, characters 4-11", "ä½ å¥½ï¼Œ\n世界", "ä½ å¥½ï¼Œ\n世界"); eq("File \"chn_test.res\", line 30, characters 4-11", convert("æ±‰å—æ˜¯ä¸–界上最美丽的character"), { - hd: 27721, + hd: 27721, + tl: { + hd: 23383, + tl: { + hd: 26159, tl: { - hd: 23383, + hd: 19990, tl: { - hd: 26159, + hd: 30028, tl: { - hd: 19990, + hd: 19978, tl: { - hd: 30028, + hd: 26368, tl: { - hd: 19978, + hd: 32654, tl: { - hd: 26368, + hd: 20029, tl: { - hd: 32654, + hd: 30340, tl: { - hd: 20029, + hd: 99, tl: { - hd: 30340, + hd: 104, tl: { - hd: 99, + hd: 97, tl: { - hd: 104, + hd: 114, tl: { hd: 97, tl: { - hd: 114, + hd: 99, tl: { - hd: 97, + hd: 116, tl: { - hd: 99, + hd: 101, tl: { - hd: 116, - tl: { - hd: 101, - tl: { - hd: 114, - tl: /* [] */0 - } - } + hd: 114, + tl: /* [] */0 } } } @@ -111,78 +109,80 @@ eq("File \"chn_test.res\", line 30, characters 4-11", convert("æ±‰å—æ˜¯ä¸–界 } } } - }); + } + } +}); eq("File \"chn_test.res\", line 54, characters 5-12", convert("\x3f\x3fa"), { - hd: 63, - tl: { - hd: 63, - tl: { - hd: 97, - tl: /* [] */0 - } - } - }); + hd: 63, + tl: { + hd: 63, + tl: { + hd: 97, + tl: /* [] */0 + } + } +}); eq("File \"chn_test.res\", line 55, characters 5-12", convert("??a"), { - hd: 63, - tl: { - hd: 63, - tl: { - hd: 97, - tl: /* [] */0 - } - } - }); + hd: 63, + tl: { + hd: 63, + tl: { + hd: 97, + tl: /* [] */0 + } + } +}); eq("File \"chn_test.res\", line 56, characters 5-12", convert("\u003f\x3fa"), { - hd: 63, - tl: { - hd: 63, - tl: { - hd: 97, - tl: /* [] */0 - } - } - }); + hd: 63, + tl: { + hd: 63, + tl: { + hd: 97, + tl: /* [] */0 + } + } +}); eq("File \"chn_test.res\", line 57, characters 5-12", convert("🚀🚀a"), { - hd: 128640, - tl: { - hd: 128640, - tl: { - hd: 97, - tl: /* [] */0 - } - } - }); + hd: 128640, + tl: { + hd: 128640, + tl: { + hd: 97, + tl: /* [] */0 + } + } +}); eq("File \"chn_test.res\", line 58, characters 5-12", convert("\uD83D\uDE80a"), { - hd: 128640, - tl: { - hd: 97, - tl: /* [] */0 - } - }); + hd: 128640, + tl: { + hd: 97, + tl: /* [] */0 + } +}); eq("File \"chn_test.res\", line 59, characters 5-12", convert("\uD83D\uDE80\x3f"), { - hd: 128640, - tl: { - hd: 63, - tl: /* [] */0 - } - }); + hd: 128640, + tl: { + hd: 63, + tl: /* [] */0 + } +}); eq("File \"chn_test.res\", line 63, characters 5-12", convert("\uD83D\uDE80\uD83D\uDE80a"), { - hd: 128640, - tl: { - hd: 128640, - tl: { - hd: 97, - tl: /* [] */0 - } - } - }); + hd: 128640, + tl: { + hd: 128640, + tl: { + hd: 97, + tl: /* [] */0 + } + } +}); eq("No inline string length", "\uD83D\uDE80\0".length, 3); @@ -191,71 +191,69 @@ eq("File \"chn_test.res\", line 70, characters 4-11", Caml_string.get("\uD83D\uD eq("File \"chn_test.res\", line 75, characters 5-12", Caml_string.get("🚀", 0), 128640); eq("File \"chn_test.res\", line 80, characters 5-12", convert("\uD83D\uDE80"), { - hd: 128640, - tl: /* [] */0 - }); + hd: 128640, + tl: /* [] */0 +}); eq("File \"chn_test.res\", line 81, characters 5-12", convert("\uD83D\uDE80\uD83D\uDE80"), { - hd: 128640, - tl: { - hd: 128640, - tl: /* [] */0 - } - }); + hd: 128640, + tl: { + hd: 128640, + tl: /* [] */0 + } +}); eq("File \"chn_test.res\", line 82, characters 5-12", convert(" \b\t\n\v\f\ra"), { - hd: 32, + hd: 32, + tl: { + hd: 8, + tl: { + hd: 9, tl: { - hd: 8, + hd: 10, tl: { - hd: 9, + hd: 11, tl: { - hd: 10, + hd: 12, tl: { - hd: 11, + hd: 13, tl: { - hd: 12, - tl: { - hd: 13, - tl: { - hd: 97, - tl: /* [] */0 - } - } + hd: 97, + tl: /* [] */0 } } } } } - }); + } + } +}); eq("File \"chn_test.res\", line 89, characters 4-11", convert(" \b\t\n\v\f\r\"'\\\0a"), { - hd: 32, + hd: 32, + tl: { + hd: 8, + tl: { + hd: 9, tl: { - hd: 8, + hd: 10, tl: { - hd: 9, + hd: 11, tl: { - hd: 10, + hd: 12, tl: { - hd: 11, + hd: 13, tl: { - hd: 12, + hd: 34, tl: { - hd: 13, + hd: 39, tl: { - hd: 34, + hd: 92, tl: { - hd: 39, + hd: 0, tl: { - hd: 92, - tl: { - hd: 0, - tl: { - hd: 97, - tl: /* [] */0 - } - } + hd: 97, + tl: /* [] */0 } } } @@ -265,7 +263,9 @@ eq("File \"chn_test.res\", line 89, characters 4-11", convert(" \b\t\n\v\f\r\"'\ } } } - }); + } + } +}); Mt.from_pair_suites("Chn_test", suites.contents); diff --git a/jscomp/test/class_type_ffi_test.js b/jscomp/test/class_type_ffi_test.js index 7a8378e774..8718f0bf7b 100644 --- a/jscomp/test/class_type_ffi_test.js +++ b/jscomp/test/class_type_ffi_test.js @@ -17,38 +17,38 @@ function ff2(fn, a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12) { function off2(o, a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12) { return Curry.app(o.huge_method, [ - a0, - a1, - a2, - a3, - a4, - a5, - a6, - a7, - a8, - a9, - a10, - a11, - a12 - ]); + a0, + a1, + a2, + a3, + a4, + a5, + a6, + a7, + a8, + a9, + a10, + a11, + a12 + ]); } function mk_f(param) { return function (a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12) { return Curry.app(a0, [ - a1, - a2, - a3, - a4, - a5, - a6, - a7, - a8, - a9, - a10, - a11, - a12 - ]); + a1, + a2, + a3, + a4, + a5, + a6, + a7, + a8, + a9, + a10, + a11, + a12 + ]); }; } diff --git a/jscomp/test/coercion_module_alias_test.js b/jscomp/test/coercion_module_alias_test.js index e24071e3e2..39ca005025 100644 --- a/jscomp/test/coercion_module_alias_test.js +++ b/jscomp/test/coercion_module_alias_test.js @@ -29,8 +29,8 @@ var f = List.length; function g(x) { return List.length(List.map((function (prim) { - return prim + 1 | 0; - }), x)); + return prim + 1 | 0; + }), x)); } function F(X) { diff --git a/jscomp/test/complex_if_test.js b/jscomp/test/complex_if_test.js index 9caa9348f2..b9b4150424 100644 --- a/jscomp/test/complex_if_test.js +++ b/jscomp/test/complex_if_test.js @@ -125,12 +125,12 @@ function string_escaped(s) { var suites_0 = [ "complete_escape", (function (param) { - return { - TAG: "Eq", - _0: Bytes.to_string(escaped(Bytes.of_string("\x00\x01\x02\x03\x04\x05\x06\x07\b\t\n\x0b\x0c\r\x0e\x0f\x10\x11\x12\x13\x14\x15\x16\x17\x18\x19\x1a\x1b\x1c\x1d\x1e\x1f !\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~\x7f\x80\x81\x82\x83\x84\x85\x86\x87\x88\x89\x8a\x8b\x8c\x8d\x8e\x8f\x90\x91\x92\x93\x94\x95\x96\x97\x98\x99\x9a\x9b\x9c\x9d\x9e\x9f\xa0\xa1\xa2\xa3\xa4\xa5\xa6\xa7\xa8\xa9\xaa\xab\xac\xad\xae\xaf\xb0\xb1\xb2\xb3\xb4\xb5\xb6\xb7\xb8\xb9\xba\xbb\xbc\xbd\xbe\xbf\xc0\xc1\xc2\xc3\xc4\xc5\xc6\xc7\xc8\xc9\xca\xcb\xcc\xcd\xce\xcf\xd0\xd1\xd2\xd3\xd4\xd5\xd6\xd7\xd8\xd9\xda\xdb\xdc\xdd\xde\xdf\xe0\xe1\xe2\xe3\xe4\xe5\xe6\xe7\xe8\xe9\xea\xeb\xec\xed\xee\xef\xf0\xf1\xf2\xf3\xf4\xf5\xf6\xf7\xf8\xf9\xfa\xfb\xfc\xfd\xfe\xff"))), - _1: "\\000\\001\\002\\003\\004\\005\\006\\007\\b\\t\\n\\011\\012\\r\\014\\015\\016\\017\\018\\019\\020\\021\\022\\023\\024\\025\\026\\027\\028\\029\\030\\031 !\\\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\\\]^_`abcdefghijklmnopqrstuvwxyz{|}~\\127\\128\\129\\130\\131\\132\\133\\134\\135\\136\\137\\138\\139\\140\\141\\142\\143\\144\\145\\146\\147\\148\\149\\150\\151\\152\\153\\154\\155\\156\\157\\158\\159\\160\\161\\162\\163\\164\\165\\166\\167\\168\\169\\170\\171\\172\\173\\174\\175\\176\\177\\178\\179\\180\\181\\182\\183\\184\\185\\186\\187\\188\\189\\190\\191\\192\\193\\194\\195\\196\\197\\198\\199\\200\\201\\202\\203\\204\\205\\206\\207\\208\\209\\210\\211\\212\\213\\214\\215\\216\\217\\218\\219\\220\\221\\222\\223\\224\\225\\226\\227\\228\\229\\230\\231\\232\\233\\234\\235\\236\\237\\238\\239\\240\\241\\242\\243\\244\\245\\246\\247\\248\\249\\250\\251\\252\\253\\254\\255" - }; - }) + return { + TAG: "Eq", + _0: Bytes.to_string(escaped(Bytes.of_string("\x00\x01\x02\x03\x04\x05\x06\x07\b\t\n\x0b\x0c\r\x0e\x0f\x10\x11\x12\x13\x14\x15\x16\x17\x18\x19\x1a\x1b\x1c\x1d\x1e\x1f !\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~\x7f\x80\x81\x82\x83\x84\x85\x86\x87\x88\x89\x8a\x8b\x8c\x8d\x8e\x8f\x90\x91\x92\x93\x94\x95\x96\x97\x98\x99\x9a\x9b\x9c\x9d\x9e\x9f\xa0\xa1\xa2\xa3\xa4\xa5\xa6\xa7\xa8\xa9\xaa\xab\xac\xad\xae\xaf\xb0\xb1\xb2\xb3\xb4\xb5\xb6\xb7\xb8\xb9\xba\xbb\xbc\xbd\xbe\xbf\xc0\xc1\xc2\xc3\xc4\xc5\xc6\xc7\xc8\xc9\xca\xcb\xcc\xcd\xce\xcf\xd0\xd1\xd2\xd3\xd4\xd5\xd6\xd7\xd8\xd9\xda\xdb\xdc\xdd\xde\xdf\xe0\xe1\xe2\xe3\xe4\xe5\xe6\xe7\xe8\xe9\xea\xeb\xec\xed\xee\xef\xf0\xf1\xf2\xf3\xf4\xf5\xf6\xf7\xf8\xf9\xfa\xfb\xfc\xfd\xfe\xff"))), + _1: "\\000\\001\\002\\003\\004\\005\\006\\007\\b\\t\\n\\011\\012\\r\\014\\015\\016\\017\\018\\019\\020\\021\\022\\023\\024\\025\\026\\027\\028\\029\\030\\031 !\\\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\\\]^_`abcdefghijklmnopqrstuvwxyz{|}~\\127\\128\\129\\130\\131\\132\\133\\134\\135\\136\\137\\138\\139\\140\\141\\142\\143\\144\\145\\146\\147\\148\\149\\150\\151\\152\\153\\154\\155\\156\\157\\158\\159\\160\\161\\162\\163\\164\\165\\166\\167\\168\\169\\170\\171\\172\\173\\174\\175\\176\\177\\178\\179\\180\\181\\182\\183\\184\\185\\186\\187\\188\\189\\190\\191\\192\\193\\194\\195\\196\\197\\198\\199\\200\\201\\202\\203\\204\\205\\206\\207\\208\\209\\210\\211\\212\\213\\214\\215\\216\\217\\218\\219\\220\\221\\222\\223\\224\\225\\226\\227\\228\\229\\230\\231\\232\\233\\234\\235\\236\\237\\238\\239\\240\\241\\242\\243\\244\\245\\246\\247\\248\\249\\250\\251\\252\\253\\254\\255" + }; + }) ]; var suites = { diff --git a/jscomp/test/complex_test.js b/jscomp/test/complex_test.js index 241a7ec060..27bd84a692 100644 --- a/jscomp/test/complex_test.js +++ b/jscomp/test/complex_test.js @@ -7,15 +7,15 @@ var Complex = require("../../lib/js/complex.js"); var suites_0 = [ "basic_add", (function (param) { - return { - TAG: "Eq", - _0: { - re: 2, - im: 2 - }, - _1: Complex.add(Complex.add(Complex.add(Complex.one, Complex.one), Complex.i), Complex.i) - }; - }) + return { + TAG: "Eq", + _0: { + re: 2, + im: 2 + }, + _1: Complex.add(Complex.add(Complex.add(Complex.one, Complex.one), Complex.i), Complex.i) + }; + }) ]; var suites = { diff --git a/jscomp/test/complex_while_loop.js b/jscomp/test/complex_while_loop.js index 6c78cb287e..b9da0bebc9 100644 --- a/jscomp/test/complex_while_loop.js +++ b/jscomp/test/complex_while_loop.js @@ -5,15 +5,15 @@ function f(param) { var n = 0; while((function () { - var fib = function (x) { - if (x === 0 || x === 1) { - return 1; - } else { - return fib(x - 1 | 0) + fib(x - 2 | 0) | 0; - } - }; - return fib(n) > 10; - })()) { + var fib = function (x) { + if (x === 0 || x === 1) { + return 1; + } else { + return fib(x - 1 | 0) + fib(x - 2 | 0) | 0; + } + }; + return fib(n) > 10; + })()) { console.log(String(n)); n = n + 1 | 0; }; @@ -21,9 +21,9 @@ function f(param) { function ff(param) { while((function () { - var b = 9; - return (3 + b | 0) > 10; - })()) { + var b = 9; + return (3 + b | 0) > 10; + })()) { }; } diff --git a/jscomp/test/condition_compilation_test.js b/jscomp/test/condition_compilation_test.js index 85303505be..97dbb21326 100644 --- a/jscomp/test/condition_compilation_test.js +++ b/jscomp/test/condition_compilation_test.js @@ -25,12 +25,12 @@ function eq(loc, x, y) { hd: [ loc + (" id " + String(test_id.contents)), (function (param) { - return { - TAG: "Eq", - _0: x, - _1: y - }; - }) + return { + TAG: "Eq", + _0: x, + _1: y + }; + }) ], tl: suites.contents }; diff --git a/jscomp/test/const_block_test.js b/jscomp/test/const_block_test.js index 9d745068f7..0bcd4bdffb 100644 --- a/jscomp/test/const_block_test.js +++ b/jscomp/test/const_block_test.js @@ -58,21 +58,21 @@ var suites_1 = { hd: [ "avoid_mutable_inline_test", (function (param) { - Caml_array.set(c, 0, 3); - Caml_array.set(c, 1, 4); - return { - TAG: "Eq", - _0: [ - 3, - 4, - 2, - 3, - 4, - 5 - ], - _1: c - }; - }) + Caml_array.set(c, 0, 3); + Caml_array.set(c, 1, 4); + return { + TAG: "Eq", + _0: [ + 3, + 4, + 2, + 3, + 4, + 5 + ], + _1: c + }; + }) ], tl: /* [] */0 }; diff --git a/jscomp/test/cps_test.js b/jscomp/test/cps_test.js index 24b2caf6df..c546f32027 100644 --- a/jscomp/test/cps_test.js +++ b/jscomp/test/cps_test.js @@ -28,8 +28,8 @@ function test(param) { }; }; f(10, (function (param) { - - })); + + })); return v.contents; } @@ -38,18 +38,18 @@ function test_closure(param) { contents: 0 }; var arr = Caml_array.make(6, (function (x) { - return x; - })); + return x; + })); for(var i = 0; i <= 5; ++i){ Caml_array.set(arr, i, (function(i){ - return function (param) { - return i; - } - }(i))); + return function (param) { + return i; + } + }(i))); } $$Array.iter((function (i) { - v.contents = v.contents + Curry._1(i, 0) | 0; - }), arr); + v.contents = v.contents + Curry._1(i, 0) | 0; + }), arr); return v.contents; } @@ -58,59 +58,59 @@ function test_closure2(param) { contents: 0 }; var arr = Caml_array.make(6, (function (x) { - return x; - })); + return x; + })); for(var i = 0; i <= 5; ++i){ var j = i + i | 0; Caml_array.set(arr, i, (function(j){ - return function (param) { - return j; - } - }(j))); + return function (param) { + return j; + } + }(j))); } $$Array.iter((function (i) { - v.contents = v.contents + Curry._1(i, 0) | 0; - }), arr); + v.contents = v.contents + Curry._1(i, 0) | 0; + }), arr); return v.contents; } Mt.from_pair_suites("Cps_test", { + hd: [ + "cps_test_sum", + (function (param) { + return { + TAG: "Eq", + _0: 55, + _1: test() + }; + }) + ], + tl: { + hd: [ + "cps_test_closure", + (function (param) { + return { + TAG: "Eq", + _0: 15, + _1: test_closure() + }; + }) + ], + tl: { hd: [ - "cps_test_sum", + "cps_test_closure2", (function (param) { - return { - TAG: "Eq", - _0: 55, - _1: test() - }; - }) + return { + TAG: "Eq", + _0: 30, + _1: test_closure2() + }; + }) ], - tl: { - hd: [ - "cps_test_closure", - (function (param) { - return { - TAG: "Eq", - _0: 15, - _1: test_closure() - }; - }) - ], - tl: { - hd: [ - "cps_test_closure2", - (function (param) { - return { - TAG: "Eq", - _0: 30, - _1: test_closure2() - }; - }) - ], - tl: /* [] */0 - } - } - }); + tl: /* [] */0 + } + } +}); exports.test = test; exports.test_closure = test_closure; diff --git a/jscomp/test/debugger_test.js b/jscomp/test/debugger_test.js index 9aa9f45d9e..50a479929b 100644 --- a/jscomp/test/debugger_test.js +++ b/jscomp/test/debugger_test.js @@ -4,9 +4,9 @@ function f(x, y) { console.log([ - x, - y - ]); + x, + y + ]); return x + y | 0; } diff --git a/jscomp/test/demo_page.js b/jscomp/test/demo_page.js index c6c41a8732..b1d0047364 100644 --- a/jscomp/test/demo_page.js +++ b/jscomp/test/demo_page.js @@ -42,12 +42,12 @@ function f(param) { } ReactDom.render(React.createClass({ - render: (function (param) { - return React.DOM.div({ - alt: "pic" - }, React.DOM.h1(undefined, "hello react"), React.DOM.h2(undefined, "type safe!")); - }) - }), document.getElementById("hi")); + render: (function (param) { + return React.DOM.div({ + alt: "pic" + }, React.DOM.h1(undefined, "hello react"), React.DOM.h2(undefined, "type safe!")); + }) +}), document.getElementById("hi")); exports.fib = fib; exports.sum = sum; diff --git a/jscomp/test/demo_pipe.js b/jscomp/test/demo_pipe.js index 17e2e570be..0159fe6a0a 100644 --- a/jscomp/test/demo_pipe.js +++ b/jscomp/test/demo_pipe.js @@ -4,10 +4,10 @@ function register(rl) { return rl.on("line", (function (x) { - console.log(x); - })).on("close", (function (param) { - console.log("finished"); - })); + console.log(x); + })).on("close", (function (param) { + console.log("finished"); + })); } exports.register = register; diff --git a/jscomp/test/digest_test.js b/jscomp/test/digest_test.js index 58ba5c30ba..57ff64e773 100644 --- a/jscomp/test/digest_test.js +++ b/jscomp/test/digest_test.js @@ -146,89 +146,89 @@ var ref = [ ]; Mt.from_pair_suites("Digest_test", Pervasives.$at({ + hd: [ + "File \"digest_test.res\", line 9, characters 9-16", + (function (param) { + return { + TAG: "Eq", + _0: Digest.to_hex(Digest.string("value")), + _1: "2063c1608d6e0baf80249c42e2be5804" + }; + }) + ], + tl: { + hd: [ + "File \"digest_test.res\", line 11, characters 10-17", + (function (param) { + return { + TAG: "Eq", + _0: Digest.to_hex(Digest.string("The quick brown fox jumps over the lazy dog")), + _1: "9e107d9d372bb6826bd81d3542a419d6" + }; + }) + ], + tl: { + hd: [ + "File \"digest_test.res\", line 18, characters 10-17", + (function (param) { + return { + TAG: "Eq", + _0: Digest.to_hex(Digest.string("The quick brown fox jumps over the lazy dog.")), + _1: "e4d909c290d0fb1ca068ffaddf22cbd0" + }; + }) + ], + tl: { + hd: [ + "File \"digest_test.res\", line 24, characters 9-16", + (function (param) { + return { + TAG: "Eq", + _0: Digest.to_hex(Digest.string("")), + _1: "d41d8cd98f00b204e9800998ecf8427e" + }; + }) + ], + tl: { hd: [ - "File \"digest_test.res\", line 9, characters 9-16", + "File \"digest_test.res\", line 26, characters 10-17", (function (param) { - return { - TAG: "Eq", - _0: Digest.to_hex(Digest.string("value")), - _1: "2063c1608d6e0baf80249c42e2be5804" - }; - }) + return { + TAG: "Eq", + _0: Digest.to_hex(Digest.string("The quick brown fox jumps over the lazy dog.The quick brown fox jumps over the lazy dog.The quick brown fox jumps over the lazy dog.The quick brown fox jumps over the lazy dog.The quick brown fox jumps over the lazy dog.The quick brown fox jumps over the lazy dog.The quick brown fox jumps over the lazy dog.The quick brown fox jumps over the lazy dog.The quick brown fox jumps over the lazy dog.The quick brown fox jumps over the lazy dog.The quick brown fox jumps over the lazy dog.The quick brown fox jumps over the lazy dog.")), + _1: "7065cc36bba1d155fb09f9d02f22e8bf" + }; + }) ], tl: { hd: [ - "File \"digest_test.res\", line 11, characters 10-17", + "File \"digest_test.res\", line 45, characters 10-17", (function (param) { - return { - TAG: "Eq", - _0: Digest.to_hex(Digest.string("The quick brown fox jumps over the lazy dog")), - _1: "9e107d9d372bb6826bd81d3542a419d6" - }; - }) + return { + TAG: "Eq", + _0: Digest.to_hex(Digest.string("The quick brown fox jumps over the lazy dog.The quick brown fox jumps over the lazy dog.The quick brown fox jumps over the lazy dog.")), + _1: "b9193d1df4b7a8f0a25ffdd1005c5b2b" + }; + }) ], - tl: { - hd: [ - "File \"digest_test.res\", line 18, characters 10-17", - (function (param) { - return { - TAG: "Eq", - _0: Digest.to_hex(Digest.string("The quick brown fox jumps over the lazy dog.")), - _1: "e4d909c290d0fb1ca068ffaddf22cbd0" - }; - }) - ], - tl: { - hd: [ - "File \"digest_test.res\", line 24, characters 9-16", - (function (param) { - return { - TAG: "Eq", - _0: Digest.to_hex(Digest.string("")), - _1: "d41d8cd98f00b204e9800998ecf8427e" - }; - }) - ], - tl: { - hd: [ - "File \"digest_test.res\", line 26, characters 10-17", - (function (param) { - return { - TAG: "Eq", - _0: Digest.to_hex(Digest.string("The quick brown fox jumps over the lazy dog.The quick brown fox jumps over the lazy dog.The quick brown fox jumps over the lazy dog.The quick brown fox jumps over the lazy dog.The quick brown fox jumps over the lazy dog.The quick brown fox jumps over the lazy dog.The quick brown fox jumps over the lazy dog.The quick brown fox jumps over the lazy dog.The quick brown fox jumps over the lazy dog.The quick brown fox jumps over the lazy dog.The quick brown fox jumps over the lazy dog.The quick brown fox jumps over the lazy dog.")), - _1: "7065cc36bba1d155fb09f9d02f22e8bf" - }; - }) - ], - tl: { - hd: [ - "File \"digest_test.res\", line 45, characters 10-17", - (function (param) { - return { - TAG: "Eq", - _0: Digest.to_hex(Digest.string("The quick brown fox jumps over the lazy dog.The quick brown fox jumps over the lazy dog.The quick brown fox jumps over the lazy dog.")), - _1: "b9193d1df4b7a8f0a25ffdd1005c5b2b" - }; - }) - ], - tl: /* [] */0 - } - } - } - } + tl: /* [] */0 } - }, $$Array.to_list($$Array.map((function (i) { - return [ - String(i), - (function (param) { - return { - TAG: "Eq", - _0: Digest.to_hex(Digest.string("a".repeat(i))), - _1: Caml_array.get(ref, i) - }; - }) - ]; - }), Ext_array_test.range(0, 129))))); + } + } + } + } +}, $$Array.to_list($$Array.map((function (i) { + return [ + String(i), + (function (param) { + return { + TAG: "Eq", + _0: Digest.to_hex(Digest.string("a".repeat(i))), + _1: Caml_array.get(ref, i) + }; + }) + ]; +}), Ext_array_test.range(0, 129))))); exports.f = f; /* Not a pure module */ diff --git a/jscomp/test/div_by_zero_test.js b/jscomp/test/div_by_zero_test.js index 2db6b2d051..a5b993cf9f 100644 --- a/jscomp/test/div_by_zero_test.js +++ b/jscomp/test/div_by_zero_test.js @@ -19,12 +19,12 @@ function eq(loc, x, y) { hd: [ loc + (" id " + String(test_id.contents)), (function (param) { - return { - TAG: "Eq", - _0: x, - _1: y - }; - }) + return { + TAG: "Eq", + _0: x, + _1: y + }; + }) ], tl: suites.contents }; @@ -38,82 +38,82 @@ function add(suite) { } add([ - "File \"div_by_zero_test.res\", line 11, characters 7-14", - (function (param) { - return { - TAG: "ThrowAny", - _0: (function (param) { - Caml_int32.div(3, 0); - }) - }; - }) - ]); + "File \"div_by_zero_test.res\", line 11, characters 7-14", + (function (param) { + return { + TAG: "ThrowAny", + _0: (function (param) { + Caml_int32.div(3, 0); + }) + }; + }) +]); add([ - "File \"div_by_zero_test.res\", line 12, characters 7-14", - (function (param) { - return { - TAG: "ThrowAny", - _0: (function (param) { - Caml_int32.mod_(3, 0); - }) - }; - }) - ]); + "File \"div_by_zero_test.res\", line 12, characters 7-14", + (function (param) { + return { + TAG: "ThrowAny", + _0: (function (param) { + Caml_int32.mod_(3, 0); + }) + }; + }) +]); add([ - "File \"div_by_zero_test.res\", line 13, characters 7-14", - (function (param) { - return { - TAG: "ThrowAny", - _0: (function (param) { - Caml_int32.div(3, 0); - }) - }; - }) - ]); + "File \"div_by_zero_test.res\", line 13, characters 7-14", + (function (param) { + return { + TAG: "ThrowAny", + _0: (function (param) { + Caml_int32.div(3, 0); + }) + }; + }) +]); add([ - "File \"div_by_zero_test.res\", line 14, characters 7-14", - (function (param) { - return { - TAG: "ThrowAny", - _0: (function (param) { - Caml_int32.mod_(3, 0); - }) - }; - }) - ]); + "File \"div_by_zero_test.res\", line 14, characters 7-14", + (function (param) { + return { + TAG: "ThrowAny", + _0: (function (param) { + Caml_int32.mod_(3, 0); + }) + }; + }) +]); add([ - "File \"div_by_zero_test.res\", line 15, characters 7-14", - (function (param) { - return { - TAG: "ThrowAny", - _0: (function (param) { - Caml_int64.div([ - 0, - 3 - ], Caml_int64.zero); - }) - }; - }) - ]); + "File \"div_by_zero_test.res\", line 15, characters 7-14", + (function (param) { + return { + TAG: "ThrowAny", + _0: (function (param) { + Caml_int64.div([ + 0, + 3 + ], Caml_int64.zero); + }) + }; + }) +]); add([ - "File \"div_by_zero_test.res\", line 16, characters 7-14", - (function (param) { - return { - TAG: "ThrowAny", - _0: (function (param) { - Caml_int64.mod_([ - 0, - 3 - ], Caml_int64.zero); - }) - }; - }) - ]); + "File \"div_by_zero_test.res\", line 16, characters 7-14", + (function (param) { + return { + TAG: "ThrowAny", + _0: (function (param) { + Caml_int64.mod_([ + 0, + 3 + ], Caml_int64.zero); + }) + }; + }) +]); function div(x, y) { return Caml_int32.div(x, y) + 3 | 0; diff --git a/jscomp/test/dollar_escape_test.js b/jscomp/test/dollar_escape_test.js index 33b1efe317..04aca38a5a 100644 --- a/jscomp/test/dollar_escape_test.js +++ b/jscomp/test/dollar_escape_test.js @@ -17,12 +17,12 @@ function eq(loc, x, y) { hd: [ loc + (" id " + String(test_id.contents)), (function (param) { - return { - TAG: "Eq", - _0: x, - _1: y - }; - }) + return { + TAG: "Eq", + _0: x, + _1: y + }; + }) ], tl: suites.contents }; diff --git a/jscomp/test/earger_curry_test.js b/jscomp/test/earger_curry_test.js index 669055d1b0..01806dd556 100644 --- a/jscomp/test/earger_curry_test.js +++ b/jscomp/test/earger_curry_test.js @@ -49,14 +49,14 @@ function fold_left(f, x, a) { function f2(param) { var arr = init(30000000, (function (i) { - return i; - })); + return i; + })); var b = map((function (i) { - return i + i - 1; - }), arr); + return i + i - 1; + }), arr); var v = fold_left((function (prim0, prim1) { - return prim0 + prim1; - }), 0, b); + return prim0 + prim1; + }), 0, b); console.log(Pervasives.string_of_float(v)); } @@ -76,12 +76,12 @@ function eq(loc, x, y) { hd: [ loc + (" id " + String(test_id.contents)), (function (param) { - return { - TAG: "Eq", - _0: x, - _1: y - }; - }) + return { + TAG: "Eq", + _0: x, + _1: y + }; + }) ], tl: suites.contents }; @@ -97,12 +97,12 @@ var all_v = { function add5(a0, a1, a2, a3, a4) { console.log([ - a0, - a1, - a2, - a3, - a4 - ]); + a0, + a1, + a2, + a3, + a4 + ]); all_v.contents = { hd: v.contents, tl: all_v.contents @@ -152,24 +152,24 @@ eq("File \"earger_curry_test.res\", line 140, characters 5-12", c, 10); eq("File \"earger_curry_test.res\", line 141, characters 5-12", d, 11); eq("File \"earger_curry_test.res\", line 142, characters 5-12", all_v.contents, { - hd: 8, + hd: 8, + tl: { + hd: 8, + tl: { + hd: 6, tl: { - hd: 8, + hd: 6, tl: { - hd: 6, + hd: 4, tl: { - hd: 6, - tl: { - hd: 4, - tl: { - hd: 2, - tl: /* [] */0 - } - } + hd: 2, + tl: /* [] */0 } } } - }); + } + } +}); Mt.from_pair_suites("Earger_curry_test", suites.contents); diff --git a/jscomp/test/epsilon_test.js b/jscomp/test/epsilon_test.js index 9ac06227c7..9e710bb2e9 100644 --- a/jscomp/test/epsilon_test.js +++ b/jscomp/test/epsilon_test.js @@ -9,24 +9,24 @@ var v = (Number.EPSILON?Number.EPSILON:2.220446049250313e-16); var suites_0 = [ "epsilon", (function (param) { - return { - TAG: "Eq", - _0: Pervasives.epsilon_float, - _1: v - }; - }) + return { + TAG: "Eq", + _0: Pervasives.epsilon_float, + _1: v + }; + }) ]; var suites_1 = { hd: [ "raw_epsilon", (function (param) { - return { - TAG: "Eq", - _0: 2.220446049250313e-16, - _1: v - }; - }) + return { + TAG: "Eq", + _0: 2.220446049250313e-16, + _1: v + }; + }) ], tl: /* [] */0 }; diff --git a/jscomp/test/equal_exception_test.js b/jscomp/test/equal_exception_test.js index 0d92159eb5..57f9b97fe7 100644 --- a/jscomp/test/equal_exception_test.js +++ b/jscomp/test/equal_exception_test.js @@ -152,8 +152,8 @@ function eq(x) { var Not_found = /* @__PURE__ */Caml_exceptions.create("Equal_exception_test.Not_found"); if (Caml_obj.equal(e, { - RE_EXN_ID: Not_found - }) !== false) { + RE_EXN_ID: Not_found + }) !== false) { throw { RE_EXN_ID: "Assert_failure", _1: [ diff --git a/jscomp/test/es6_module_test.js b/jscomp/test/es6_module_test.js index 22c2803c3a..50c8346001 100644 --- a/jscomp/test/es6_module_test.js +++ b/jscomp/test/es6_module_test.js @@ -9,36 +9,36 @@ function length(param) { } Mt.from_pair_suites("Es6_module_test", { - hd: [ - "list_length", - (function (param) { - return { - TAG: "Eq", - _0: List.length({ - hd: 1, - tl: { - hd: 2, - tl: /* [] */0 - } - }), - _1: 2 - }; - }) - ], - tl: { - hd: [ - "length", - (function (param) { - return { - TAG: "Eq", - _0: 3, - _1: 3 - }; - }) - ], - tl: /* [] */0 - } - }); + hd: [ + "list_length", + (function (param) { + return { + TAG: "Eq", + _0: List.length({ + hd: 1, + tl: { + hd: 2, + tl: /* [] */0 + } + }), + _1: 2 + }; + }) + ], + tl: { + hd: [ + "length", + (function (param) { + return { + TAG: "Eq", + _0: 3, + _1: 3 + }; + }) + ], + tl: /* [] */0 + } +}); exports.length = length; /* Not a pure module */ diff --git a/jscomp/test/exception_alias.js b/jscomp/test/exception_alias.js index c83f4f0d39..98cc19f7fe 100644 --- a/jscomp/test/exception_alias.js +++ b/jscomp/test/exception_alias.js @@ -8,12 +8,12 @@ var a0 = { }; var b = List.length({ - hd: 1, - tl: { - hd: 2, - tl: /* [] */0 - } - }); + hd: 1, + tl: { + hd: 2, + tl: /* [] */0 + } +}); var List$1 = { compare_lengths: List.compare_lengths, diff --git a/jscomp/test/exception_raise_test.js b/jscomp/test/exception_raise_test.js index 292bbb351e..96e27358c4 100644 --- a/jscomp/test/exception_raise_test.js +++ b/jscomp/test/exception_raise_test.js @@ -135,44 +135,44 @@ var suites = { hd: [ "File \"exception_raise_test.res\", line 120, characters 5-12", (function (param) { - return { - TAG: "Eq", - _0: [ - f, - ff, - fff, - a0 - ], - _1: [ - 2, - 2, - 2, - 2 - ] - }; - }) + return { + TAG: "Eq", + _0: [ + f, + ff, + fff, + a0 + ], + _1: [ + 2, + 2, + 2, + 2 + ] + }; + }) ], tl: { hd: [ "File \"exception_raise_test.res\", line 123, characters 6-13", (function (param) { - if (a1.RE_EXN_ID === Js_exn.$$Error) { - return { - TAG: "Eq", - _0: a1._1, - _1: 2 - }; - } - throw { - RE_EXN_ID: "Assert_failure", - _1: [ - "exception_raise_test.res", - 127, - 15 - ], - Error: new Error() + if (a1.RE_EXN_ID === Js_exn.$$Error) { + return { + TAG: "Eq", + _0: a1._1, + _1: 2 }; - }) + } + throw { + RE_EXN_ID: "Assert_failure", + _1: [ + "exception_raise_test.res", + 127, + 15 + ], + Error: new Error() + }; + }) ], tl: /* [] */0 } diff --git a/jscomp/test/exception_rebound_err_test.js b/jscomp/test/exception_rebound_err_test.js index 17b37ccdd5..0e11e84aaa 100644 --- a/jscomp/test/exception_rebound_err_test.js +++ b/jscomp/test/exception_rebound_err_test.js @@ -20,12 +20,12 @@ function eq(loc, x, y) { hd: [ loc + (" id " + String(test_id.contents)), (function (param) { - return { - TAG: "Eq", - _0: x, - _1: y - }; - }) + return { + TAG: "Eq", + _0: x, + _1: y + }; + }) ], tl: suites.contents }; diff --git a/jscomp/test/ext_array_test.js b/jscomp/test/ext_array_test.js index 9f29e9b5cd..0e90858fa9 100644 --- a/jscomp/test/ext_array_test.js +++ b/jscomp/test/ext_array_test.js @@ -113,8 +113,8 @@ function range(from, to_) { }; } return $$Array.init((to_ - from | 0) + 1 | 0, (function (i) { - return i + from | 0; - })); + return i + from | 0; + })); } function map2i(f, a, b) { @@ -127,8 +127,8 @@ function map2i(f, a, b) { }; } return $$Array.mapi((function (i, a) { - return Curry._3(f, i, a, b[i]); - }), a); + return Curry._3(f, i, a, b[i]); + }), a); } function tolist_aux(a, f, _i, _res) { diff --git a/jscomp/test/ext_bytes_test.js b/jscomp/test/ext_bytes_test.js index b8cf703304..3a2bd14234 100644 --- a/jscomp/test/ext_bytes_test.js +++ b/jscomp/test/ext_bytes_test.js @@ -172,16 +172,16 @@ var f = Char.chr; var a$2 = Bytes.unsafe_to_string(Bytes.init(100, f)); var b = Bytes.init(100, (function (i) { - return /* '\000' */0; - })); + return /* '\000' */0; +})); Bytes.blit_string(a$2, 10, b, 5, 10); eq("File \"ext_bytes_test.res\", line 141, characters 4-11", b, Bytes.of_string("\x00\x00\x00\x00\x00\n\x0b\x0c\r\x0e\x0f\x10\x11\x12\x13\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00")); var s = Bytes.init(50000, (function (i) { - return Char.chr(i % 137); - })); + return Char.chr(i % 137); +})); var s1 = Bytes.to_string(s); diff --git a/jscomp/test/ext_filename_test.js b/jscomp/test/ext_filename_test.js index 42a2f700c2..6b1d38112a 100644 --- a/jscomp/test/ext_filename_test.js +++ b/jscomp/test/ext_filename_test.js @@ -21,8 +21,8 @@ var node_parent = ".."; var node_current = "."; var cwd = CamlinternalLazy.from_fun(function () { - return Caml_sys.sys_getcwd(); - }); + return Caml_sys.sys_getcwd(); +}); function path_as_directory(x) { if (x === "" || Ext_string_test.ends_with(x, Filename.dir_sep)) { @@ -105,8 +105,8 @@ function relative_path(file_or_dir_1, file_or_dir_2) { continue ; } return Pervasives.$at(List.map((function (param) { - return node_parent; - }), dir2), dir1); + return node_parent; + }), dir2), dir1); }; }; var ys = go(dir1, dir2); @@ -133,18 +133,18 @@ function node_relative_path(node_modules_shorten, file1, dep_file) { var len = file2.length; if (!(node_modules_shorten && v >= 0)) { return relative_path(dep_file.NAME === "File" ? ({ - NAME: "File", - VAL: absolute_path(dep_file.VAL) - }) : ({ - NAME: "Dir", - VAL: absolute_path(dep_file.VAL) - }), file1.NAME === "File" ? ({ - NAME: "File", - VAL: absolute_path(file1.VAL) - }) : ({ - NAME: "Dir", - VAL: absolute_path(file1.VAL) - })) + (node_sep + Curry._1(Filename.basename, file2)); + NAME: "File", + VAL: absolute_path(dep_file.VAL) + }) : ({ + NAME: "Dir", + VAL: absolute_path(dep_file.VAL) + }), file1.NAME === "File" ? ({ + NAME: "File", + VAL: absolute_path(file1.VAL) + }) : ({ + NAME: "Dir", + VAL: absolute_path(file1.VAL) + })) + (node_sep + Curry._1(Filename.basename, file2)); } var skip = function (_i) { while(true) { @@ -193,9 +193,9 @@ function find_package_json_dir(cwd) { } var package_dir = CamlinternalLazy.from_fun(function () { - var cwd$1 = CamlinternalLazy.force(cwd); - return find_root_filename(cwd$1, Test_literals.bsconfig_json); - }); + var cwd$1 = CamlinternalLazy.force(cwd); + return find_root_filename(cwd$1, Test_literals.bsconfig_json); +}); function module_name_of_file(file) { var s = Filename.chop_extension(Curry._1(Filename.basename, file)); @@ -268,8 +268,8 @@ function rel_normalized_absolute_path(from, to_) { var xs = xss.tl; if (!yss) { return List.fold_left((function (acc, param) { - return Filename.concat(acc, Ext_string_test.parent_dir_lit); - }), Ext_string_test.parent_dir_lit, xs); + return Filename.concat(acc, Ext_string_test.parent_dir_lit); + }), Ext_string_test.parent_dir_lit, xs); } if (xss.hd === yss.hd) { _yss = yss.tl; @@ -277,8 +277,8 @@ function rel_normalized_absolute_path(from, to_) { continue ; } var start = List.fold_left((function (acc, param) { - return Filename.concat(acc, Ext_string_test.parent_dir_lit); - }), Ext_string_test.parent_dir_lit, xs); + return Filename.concat(acc, Ext_string_test.parent_dir_lit); + }), Ext_string_test.parent_dir_lit, xs); return List.fold_left(Filename.concat, start, yss); }; } @@ -351,8 +351,8 @@ var simple_convert_node_path_to_os_path; if (Sys.unix) { simple_convert_node_path_to_os_path = (function (x) { - return x; - }); + return x; + }); } else if (Sys.win32 || false) { simple_convert_node_path_to_os_path = Ext_string_test.replace_slash_backward; } else { diff --git a/jscomp/test/ext_list_test.js b/jscomp/test/ext_list_test.js index 52f77f37e7..f4f5606243 100644 --- a/jscomp/test/ext_list_test.js +++ b/jscomp/test/ext_list_test.js @@ -634,8 +634,8 @@ function for_all_opt(p, _x) { function fold(f, l, init) { return List.fold_left((function (acc, i) { - return Curry._2(f, i, init); - }), init, l); + return Curry._2(f, i, init); + }), init, l); } function rev_map_acc(acc, f, l) { @@ -760,8 +760,8 @@ function reduce_from_right(fn, lst) { var match = List.rev(lst); if (match) { return List.fold_left((function (x, y) { - return Curry._2(fn, y, x); - }), match.hd, match.tl); + return Curry._2(fn, y, x); + }), match.hd, match.tl); } throw { RE_EXN_ID: "Invalid_argument", diff --git a/jscomp/test/ext_string_test.js b/jscomp/test/ext_string_test.js index 8e599422eb..9256d655e1 100644 --- a/jscomp/test/ext_string_test.js +++ b/jscomp/test/ext_string_test.js @@ -56,24 +56,24 @@ function trim(s) { var i = 0; var j = s.length; while((function () { - var tmp = false; - if (i < j) { - var u = s.codePointAt(i); - tmp = u === /* '\t' */9 || u === /* '\n' */10 || u === /* ' ' */32; - } - return tmp; - })()) { + var tmp = false; + if (i < j) { + var u = s.codePointAt(i); + tmp = u === /* '\t' */9 || u === /* '\n' */10 || u === /* ' ' */32; + } + return tmp; + })()) { i = i + 1 | 0; }; var k = j - 1 | 0; while((function () { - var tmp = false; - if (k >= i) { - var u = s.codePointAt(k); - tmp = u === /* '\t' */9 || u === /* '\n' */10 || u === /* ' ' */32; - } - return tmp; - })()) { + var tmp = false; + if (k >= i) { + var u = s.codePointAt(k); + tmp = u === /* '\t' */9 || u === /* '\n' */10 || u === /* ' ' */32; + } + return tmp; + })()) { k = k - 1 | 0; }; return $$String.sub(s, i, (k - i | 0) + 1 | 0); @@ -84,19 +84,19 @@ function split(keep_empty, str, on) { return /* [] */0; } else { return split_by(keep_empty, (function (x) { - return x === on; - }), str); + return x === on; + }), str); } } function quick_split_by_ws(str) { return split_by(false, (function (x) { - if (x === /* '\t' */9 || x === /* '\n' */10) { - return true; - } else { - return x === /* ' ' */32; - } - }), str); + if (x === /* '\t' */9 || x === /* '\n' */10) { + return true; + } else { + return x === /* ' ' */32; + } + }), str); } function starts_with(s, beg) { @@ -149,8 +149,8 @@ function ends_with_then_chop(s, beg) { function check_any_suffix_case(s, suffixes) { return List.exists((function (x) { - return ends_with(s, x); - }), suffixes); + return ends_with(s, x); + }), suffixes); } function check_any_suffix_case_then_chop(s, suffixes) { @@ -444,18 +444,18 @@ function is_valid_module_file(s) { return false; } return unsafe_for_all_range(s, 1, len - 1 | 0, (function (x) { - if (x >= 65) { - if (x > 96 || x < 91) { - return x < 123; - } else { - return x === 95; - } - } else if (x >= 48) { - return x < 58; - } else { - return x === 39; - } - })); + if (x >= 65) { + if (x > 96 || x < 91) { + return x < 123; + } else { + return x === 95; + } + } else if (x >= 48) { + return x < 58; + } else { + return x === 39; + } + })); } function is_valid_npm_package_name(s) { @@ -476,34 +476,34 @@ function is_valid_npm_package_name(s) { return false; } return unsafe_for_all_range(s, 1, len - 1 | 0, (function (x) { - if (x >= 58) { - if (x >= 97) { - return x < 123; - } else { - return x === 95; - } - } else if (x !== 45) { - return x >= 48; - } else { - return true; - } - })); + if (x >= 58) { + if (x >= 97) { + return x < 123; + } else { + return x === 95; + } + } else if (x !== 45) { + return x >= 48; + } else { + return true; + } + })); } function is_valid_source_name(name) { var x = check_any_suffix_case_then_chop(name, { - hd: ".ml", + hd: ".ml", + tl: { + hd: ".res", + tl: { + hd: ".mli", tl: { - hd: ".res", - tl: { - hd: ".mli", - tl: { - hd: ".resi", - tl: /* [] */0 - } - } + hd: ".resi", + tl: /* [] */0 } - }); + } + } + }); if (x !== undefined) { if (is_valid_module_file(x)) { return "Good"; @@ -569,12 +569,12 @@ function replace_slash_backward(x) { return x; } else { return $$String.map((function (x) { - if (x !== 47) { - return x; - } else { - return /* '\\' */92; - } - }), x); + if (x !== 47) { + return x; + } else { + return /* '\\' */92; + } + }), x); } } @@ -584,12 +584,12 @@ function replace_backward_slash(x) { return x; } else { return $$String.map((function (x) { - if (x !== 92) { - return x; - } else { - return /* '/' */47; - } - }), x); + if (x !== 92) { + return x; + } else { + return /* '/' */47; + } + }), x); } } diff --git a/jscomp/test/extensible_variant_test.js b/jscomp/test/extensible_variant_test.js index 578c9f165d..ca2eae284f 100644 --- a/jscomp/test/extensible_variant_test.js +++ b/jscomp/test/extensible_variant_test.js @@ -38,46 +38,46 @@ function to_int(x) { var suites_0 = [ "test_int", (function (param) { - return { - TAG: "Eq", - _0: 3, - _1: to_int({ - RE_EXN_ID: Int, - _1: 3, - _2: 0 - }) - }; - }) + return { + TAG: "Eq", + _0: 3, + _1: to_int({ + RE_EXN_ID: Int, + _1: 3, + _2: 0 + }) + }; + }) ]; var suites_1 = { hd: [ "test_int2", (function (param) { - return { - TAG: "Eq", - _0: 0, - _1: to_int({ - RE_EXN_ID: Int$1, - _1: 3, - _2: 0 - }) - }; - }) + return { + TAG: "Eq", + _0: 0, + _1: to_int({ + RE_EXN_ID: Int$1, + _1: 3, + _2: 0 + }) + }; + }) ], tl: { hd: [ "test_string", (function (param) { - return { - TAG: "Eq", - _0: -1, - _1: to_int({ - RE_EXN_ID: Str, - _1: "x" - }) - }; - }) + return { + TAG: "Eq", + _0: -1, + _1: to_int({ + RE_EXN_ID: Str, + _1: "x" + }) + }; + }) ], tl: /* [] */0 } diff --git a/jscomp/test/ffi_arity_test.js b/jscomp/test/ffi_arity_test.js index 655c75b977..5250f2f254 100644 --- a/jscomp/test/ffi_arity_test.js +++ b/jscomp/test/ffi_arity_test.js @@ -17,28 +17,28 @@ function f(v) { } var v = [ - 1, - 2, - 3 - ].map(function (a, b) { - return f(a)(b); - }); + 1, + 2, + 3 +].map(function (a, b) { + return f(a)(b); +}); var vv = [ - 1, - 2, - 3 - ].map(function (a, b) { - return a + b | 0; - }); + 1, + 2, + 3 +].map(function (a, b) { + return a + b | 0; +}); var hh = [ - "1", - "2", - "3" - ].map(function (x) { - return parseInt(x); - }); + "1", + "2", + "3" +].map(function (x) { + return parseInt(x); +}); function u() { return 3; @@ -69,54 +69,54 @@ var abc_u = abc; fff(); Mt.from_pair_suites("Ffi_arity_test", { + hd: [ + "File \"ffi_arity_test.res\", line 51, characters 7-14", + (function (param) { + return { + TAG: "Eq", + _0: v, + _1: [ + 0, + 1, + 4 + ] + }; + }) + ], + tl: { + hd: [ + "File \"ffi_arity_test.res\", line 52, characters 7-14", + (function (param) { + return { + TAG: "Eq", + _0: vv, + _1: [ + 1, + 3, + 5 + ] + }; + }) + ], + tl: { hd: [ - "File \"ffi_arity_test.res\", line 51, characters 7-14", + "File \"ffi_arity_test.res\", line 53, characters 7-14", (function (param) { - return { - TAG: "Eq", - _0: v, - _1: [ - 0, - 1, - 4 - ] - }; - }) + return { + TAG: "Eq", + _0: hh, + _1: [ + 1, + 2, + 3 + ] + }; + }) ], - tl: { - hd: [ - "File \"ffi_arity_test.res\", line 52, characters 7-14", - (function (param) { - return { - TAG: "Eq", - _0: vv, - _1: [ - 1, - 3, - 5 - ] - }; - }) - ], - tl: { - hd: [ - "File \"ffi_arity_test.res\", line 53, characters 7-14", - (function (param) { - return { - TAG: "Eq", - _0: hh, - _1: [ - 1, - 2, - 3 - ] - }; - }) - ], - tl: /* [] */0 - } - } - }); + tl: /* [] */0 + } + } +}); function bar(fn) { return Curry._1(fn, undefined); diff --git a/jscomp/test/ffi_array_test.js b/jscomp/test/ffi_array_test.js index 4bf2e61a96..d906908811 100644 --- a/jscomp/test/ffi_array_test.js +++ b/jscomp/test/ffi_array_test.js @@ -17,30 +17,30 @@ function eq(loc, x, y) { hd: [ loc + (" id " + String(test_id.contents)), (function (param) { - return { - TAG: "Eq", - _0: x, - _1: y - }; - }) + return { + TAG: "Eq", + _0: x, + _1: y + }; + }) ], tl: suites.contents }; } eq("File \"ffi_array_test.res\", line 11, characters 12-19", [ - 1, - 2, - 3, - 4 - ].map(function (x) { - return x + 1 | 0; - }), [ - 2, - 3, - 4, - 5 - ]); + 1, + 2, + 3, + 4 +].map(function (x) { + return x + 1 | 0; +}), [ + 2, + 3, + 4, + 5 +]); Mt.from_pair_suites("Ffi_array_test", suites.contents); diff --git a/jscomp/test/ffi_js_test.js b/jscomp/test/ffi_js_test.js index b25a212821..e787eda018 100644 --- a/jscomp/test/ffi_js_test.js +++ b/jscomp/test/ffi_js_test.js @@ -28,12 +28,12 @@ function eq(loc, param) { hd: [ loc + (" id " + String(test_id.contents)), (function (param) { - return { - TAG: "Eq", - _0: x, - _1: y - }; - }) + return { + TAG: "Eq", + _0: x, + _1: y + }; + }) ], tl: suites.contents }; @@ -50,9 +50,9 @@ var string_config = { }; eq("File \"ffi_js_test.res\", line 30, characters 12-19", [ - 6, - $$higher_order(1)(2, 3) - ]); + 6, + $$higher_order(1)(2, 3) +]); var same_type_0 = { hd: int_config, @@ -82,28 +82,28 @@ var same_type = [ ]; eq("File \"ffi_js_test.res\", line 38, characters 5-12", [ - Object.keys(int_config).length, - 2 - ]); + Object.keys(int_config).length, + 2 +]); eq("File \"ffi_js_test.res\", line 39, characters 5-12", [ - Object.keys(string_config).length, - 2 - ]); + Object.keys(string_config).length, + 2 +]); var u = { contents: 3 }; var side_effect_config = (u.contents = u.contents + 1 | 0, "Int", { - hi: 3, - low: 32 - }); + hi: 3, + low: 32 +}); eq("File \"ffi_js_test.res\", line 53, characters 12-19", [ - u.contents, - 4 - ]); + u.contents, + 4 +]); function vv(z) { return z.hh(); @@ -141,9 +141,9 @@ function ffff(x) { ]; var match = x[3]; console.log([ - match[0], - match[1] - ]); + match[0], + match[1] + ]); console.log(x.getGADT); var match$1 = x.getGADT2; console.log(match$1[0], match$1[1]); diff --git a/jscomp/test/ffi_splice_test.js b/jscomp/test/ffi_splice_test.js index c82b48c80b..27500b5281 100644 --- a/jscomp/test/ffi_splice_test.js +++ b/jscomp/test/ffi_splice_test.js @@ -17,12 +17,12 @@ function eq(loc, x, y) { hd: [ loc + (" id " + String(test_id.contents)), (function (param) { - return { - TAG: "Eq", - _0: x, - _1: y - }; - }) + return { + TAG: "Eq", + _0: x, + _1: y + }; + }) ], tl: suites.contents }; diff --git a/jscomp/test/flexible_array_test.js b/jscomp/test/flexible_array_test.js index 7f5b80995c..9f750278c3 100644 --- a/jscomp/test/flexible_array_test.js +++ b/jscomp/test/flexible_array_test.js @@ -262,11 +262,11 @@ function sort(s) { } var head = get(s, 0); var larger = sort(filter_from(1, (function (x) { - return Caml_obj.greaterthan(x, head); - }), s)); + return Caml_obj.greaterthan(x, head); + }), s)); var smaller = sort(filter_from(1, (function (x) { - return Caml_obj.lessequal(x, head); - }), s)); + return Caml_obj.lessequal(x, head); + }), s)); return append(smaller, push_front(larger, head)); } @@ -299,24 +299,24 @@ function $eq$tilde(x, y) { } var u = of_array([ - 1, - 2, - 2, - 5, - 3, - 6 - ]); + 1, + 2, + 2, + 5, + 3, + 6 +]); var x = sort(u); if (!Caml_obj.equal(x, of_array([ - 1, - 2, - 2, - 3, - 5, - 6 - ]))) { + 1, + 2, + 2, + 3, + 5, + 6 + ]))) { throw { RE_EXN_ID: "Assert_failure", _1: [ @@ -329,12 +329,12 @@ if (!Caml_obj.equal(x, of_array([ } var v = $$Array.init(500, (function (i) { - return 500 - i | 0; - })); + return 500 - i | 0; +})); var y = $$Array.init(500, (function (i) { - return i + 1 | 0; - })); + return i + 1 | 0; +})); var x$1 = sort(of_array(v)); diff --git a/jscomp/test/float_of_bits_test.js b/jscomp/test/float_of_bits_test.js index ff1db3580c..8a87ef8bdc 100644 --- a/jscomp/test/float_of_bits_test.js +++ b/jscomp/test/float_of_bits_test.js @@ -26,61 +26,61 @@ var int32_pairs = [ function from_pairs(pair) { return List.concat($$Array.to_list($$Array.mapi((function (i, param) { - var f = param[1]; - var i32 = param[0]; - return { - hd: [ - "int32_float_of_bits " + i, - (function (param) { - return { - TAG: "Eq", - _0: Caml_float.int_float_of_bits(i32), - _1: f - }; - }) - ], - tl: { - hd: [ - "int32_bits_of_float " + i, - (function (param) { - return { - TAG: "Eq", - _0: Caml_float.int_bits_of_float(f), - _1: i32 - }; - }) - ], - tl: /* [] */0 - } - }; - }), int32_pairs))); -} - -var suites = Pervasives.$at({ + var f = param[1]; + var i32 = param[0]; + return { hd: [ - "one", + "int32_float_of_bits " + i, (function (param) { - return { - TAG: "Eq", - _0: Caml_int64.bits_of_float(1.0), - _1: one_float - }; - }) + return { + TAG: "Eq", + _0: Caml_float.int_float_of_bits(i32), + _1: f + }; + }) ], tl: { hd: [ - "two", + "int32_bits_of_float " + i, (function (param) { - return { - TAG: "Eq", - _0: Caml_int64.float_of_bits(one_float), - _1: 1.0 - }; - }) + return { + TAG: "Eq", + _0: Caml_float.int_bits_of_float(f), + _1: i32 + }; + }) ], tl: /* [] */0 } - }, from_pairs(int32_pairs)); + }; + }), int32_pairs))); +} + +var suites = Pervasives.$at({ + hd: [ + "one", + (function (param) { + return { + TAG: "Eq", + _0: Caml_int64.bits_of_float(1.0), + _1: one_float + }; + }) + ], + tl: { + hd: [ + "two", + (function (param) { + return { + TAG: "Eq", + _0: Caml_int64.float_of_bits(one_float), + _1: 1.0 + }; + }) + ], + tl: /* [] */0 + } +}, from_pairs(int32_pairs)); Mt.from_pair_suites("Float_of_bits_test", suites); diff --git a/jscomp/test/float_test.js b/jscomp/test/float_test.js index f8af860f88..b842335ae0 100644 --- a/jscomp/test/float_test.js +++ b/jscomp/test/float_test.js @@ -31,9 +31,9 @@ function approx(loc) { } var epsilon_float = Caml_int64.float_of_bits([ - 1018167296, - 0 - ]); + 1018167296, + 0 +]); var match = Caml_float.frexp_float(12.0); @@ -42,100 +42,100 @@ var match$1 = Caml_float.frexp_float(0); var match$2 = Caml_float.frexp_float(-12.0); var results = $$Array.append([ - [ - Math.log10(2), - 0.301029995663981198 - ], - [ - Caml_float.ldexp_float(1, 6), - 64 - ], - [ - Caml_float.ldexp_float(1, 5), - 32 - ], - [ - Caml_float.ldexp_float(1.e-5, 1024), - 1.79769313486231605e+303 - ], - [ - Caml_float.ldexp_float(1, -1024), - 5.56268464626800346e-309 - ], - [ - Caml_float.hypot_float(3, 4), - 5 - ], - [ - Caml_float.hypot_float(4, 3), - 5 - ], - [ - Caml_float.hypot_float(5, 12), - 13 - ], - [ - Caml_float.hypot_float(12, 5), - 13 - ], - [ - Caml_float.copysign_float(22.3, -1), - -22.3 - ], - [ - Caml_float.copysign_float(22.3, 1), - 22.3 - ], - [ - Caml_float.expm1_float(1e-15), - 1.00000000000000067e-15 - ], - [ - Math.log1p(1e-10), - 9.9999999995000007e-11 - ] - ], [ - [ - match$1[0], - 0 - ], - [ - match$1[1], - 0 - ], - [ - match[0], - 0.75 - ], - [ - match[1], - 4 - ], - [ - match$2[0], - -0.75 - ], - [ - match$2[1], - 4 - ] - ]); + [ + Math.log10(2), + 0.301029995663981198 + ], + [ + Caml_float.ldexp_float(1, 6), + 64 + ], + [ + Caml_float.ldexp_float(1, 5), + 32 + ], + [ + Caml_float.ldexp_float(1.e-5, 1024), + 1.79769313486231605e+303 + ], + [ + Caml_float.ldexp_float(1, -1024), + 5.56268464626800346e-309 + ], + [ + Caml_float.hypot_float(3, 4), + 5 + ], + [ + Caml_float.hypot_float(4, 3), + 5 + ], + [ + Caml_float.hypot_float(5, 12), + 13 + ], + [ + Caml_float.hypot_float(12, 5), + 13 + ], + [ + Caml_float.copysign_float(22.3, -1), + -22.3 + ], + [ + Caml_float.copysign_float(22.3, 1), + 22.3 + ], + [ + Caml_float.expm1_float(1e-15), + 1.00000000000000067e-15 + ], + [ + Math.log1p(1e-10), + 9.9999999995000007e-11 + ] +], [ + [ + match$1[0], + 0 + ], + [ + match$1[1], + 0 + ], + [ + match[0], + 0.75 + ], + [ + match[1], + 4 + ], + [ + match$2[0], + -0.75 + ], + [ + match$2[1], + 4 + ] +]); function from_pairs(ps) { return $$Array.to_list($$Array.mapi((function (i, param) { - var b = param[1]; - var a = param[0]; - return [ - "pair " + i, - (function (param) { - return { - TAG: "Approx", - _0: a, - _1: b - }; - }) - ]; - }), ps)); + var b = param[1]; + var a = param[0]; + return [ + "pair " + i, + (function (param) { + return { + TAG: "Approx", + _0: a, + _1: b + }; + }) + ]; + }), ps)); } var float_compare = Caml.float_compare; @@ -181,48 +181,48 @@ var generic_greaterequal = Caml_obj.greaterequal; Mt_global.collect_eq(test_id, suites, "File \"float_test.res\", line 59, characters 5-12", Pervasives.classify_float(3), "FP_normal"); Mt_global.collect_eq(test_id, suites, "File \"float_test.res\", line 60, characters 5-12", Caml_float.modf_float(-3.125), [ - -0.125, - -3 - ]); + -0.125, + -3 +]); var match$3 = Caml_float.modf_float(Number.NaN); Mt_global.collect_eq(test_id, suites, "File \"float_test.res\", line 62, characters 4-11", [ - Number.isNaN(match$3[0]), - Number.isNaN(match$3[1]) - ], [ - true, - true - ]); + Number.isNaN(match$3[0]), + Number.isNaN(match$3[1]) +], [ + true, + true +]); Mt_global.collect_eq(test_id, suites, "File \"float_test.res\", line 71, characters 4-11", $$Array.map((function (x) { - if (x > 0) { - return 1; - } else if (x < 0) { - return -1; - } else { - return 0; - } - }), $$Array.map((function (param) { - return Caml.float_compare(param[0], param[1]); - }), [ - [ - 1, - 3 - ], - [ - 2, - 1 - ], - [ - 3, - 2 - ] - ])), [ - -1, - 1, - 1 - ]); + if (x > 0) { + return 1; + } else if (x < 0) { + return -1; + } else { + return 0; + } +}), $$Array.map((function (param) { + return Caml.float_compare(param[0], param[1]); +}), [ + [ + 1, + 3 + ], + [ + 2, + 1 + ], + [ + 3, + 2 + ] +])), [ + -1, + 1, + 1 +]); Mt_global.collect_eq(test_id, suites, "File \"float_test.res\", line 83, characters 5-12", Caml_float.copysign_float(-3, 0), 3); @@ -327,54 +327,54 @@ var b = match$4[1]; var a = match$4[0]; Mt.from_pair_suites("Float_test", Pervasives.$at({ - hd: [ - "mod_float", - (function (param) { - return { - TAG: "Approx", - _0: 3.2 % 0.5, - _1: 0.200000000000000178 - }; - }) - ], - tl: { - hd: [ - "modf_float1", - (function (param) { - return { - TAG: "Approx", - _0: a, - _1: 0.299999999999997158 - }; - }) - ], - tl: { - hd: [ - "modf_float2", - (function (param) { - return { - TAG: "Approx", - _0: b, - _1: 32 - }; - }) - ], - tl: { - hd: [ - "int_of_float", - (function (param) { - return { - TAG: "Eq", - _0: 3, - _1: 3 - }; - }) - ], - tl: /* [] */0 - } - } - } - }, Pervasives.$at(from_pairs(results), suites.contents))); + hd: [ + "mod_float", + (function (param) { + return { + TAG: "Approx", + _0: 3.2 % 0.5, + _1: 0.200000000000000178 + }; + }) + ], + tl: { + hd: [ + "modf_float1", + (function (param) { + return { + TAG: "Approx", + _0: a, + _1: 0.299999999999997158 + }; + }) + ], + tl: { + hd: [ + "modf_float2", + (function (param) { + return { + TAG: "Approx", + _0: b, + _1: 32 + }; + }) + ], + tl: { + hd: [ + "int_of_float", + (function (param) { + return { + TAG: "Eq", + _0: 3, + _1: 3 + }; + }) + ], + tl: /* [] */0 + } + } + } +}, Pervasives.$at(from_pairs(results), suites.contents))); exports.test_id = test_id; exports.suites = suites; diff --git a/jscomp/test/floatarray_test.js b/jscomp/test/floatarray_test.js index c8d86e139f..465e00be66 100644 --- a/jscomp/test/floatarray_test.js +++ b/jscomp/test/floatarray_test.js @@ -25,14 +25,14 @@ for(var i = 0; i <= 4; ++i){ Caml_array.set(v, 2, 15.5); eq("File \"floatarray_test.res\", line 15, characters 5-12", [ - v.length, - v[2], - Caml_array.get(v, 1) - ], [ - 5, - 15.5, - 0 - ]); + v.length, + v[2], + Caml_array.get(v, 1) +], [ + 5, + 15.5, + 0 +]); Mt.from_pair_suites("Floatarray_test", suites.contents); diff --git a/jscomp/test/for_loop_test.js b/jscomp/test/for_loop_test.js index 83ba006927..acfee78076 100644 --- a/jscomp/test/for_loop_test.js +++ b/jscomp/test/for_loop_test.js @@ -11,19 +11,19 @@ function for_3(x) { contents: 0 }; var arr = $$Array.map((function (param, param$1) { - - }), x); + + }), x); for(var i = 0 ,i_finish = x.length; i < i_finish; ++i){ var j = (i << 1); Caml_array.set(arr, i, (function(j){ - return function (param) { - v.contents = v.contents + j | 0; - } - }(j))); + return function (param) { + v.contents = v.contents + j | 0; + } + }(j))); } $$Array.iter((function (x) { - Curry._1(x, undefined); - }), arr); + Curry._1(x, undefined); + }), arr); return v.contents; } @@ -32,20 +32,20 @@ function for_4(x) { contents: 0 }; var arr = $$Array.map((function (param, param$1) { - - }), x); + + }), x); for(var i = 0 ,i_finish = x.length; i < i_finish; ++i){ var j = (i << 1); var k = (j << 1); Caml_array.set(arr, i, (function(k){ - return function (param) { - v.contents = v.contents + k | 0; - } - }(k))); + return function (param) { + v.contents = v.contents + k | 0; + } + }(k))); } $$Array.iter((function (x) { - Curry._1(x, undefined); - }), arr); + Curry._1(x, undefined); + }), arr); return v.contents; } @@ -54,19 +54,19 @@ function for_5(x, u) { contents: 0 }; var arr = $$Array.map((function (param, param$1) { - - }), x); + + }), x); for(var i = 0 ,i_finish = x.length; i < i_finish; ++i){ var k = Math.imul((u << 1), u); Caml_array.set(arr, i, (function(k){ - return function (param) { - v.contents = v.contents + k | 0; - } - }(k))); + return function (param) { + v.contents = v.contents + k | 0; + } + }(k))); } $$Array.iter((function (x) { - Curry._1(x, undefined); - }), arr); + Curry._1(x, undefined); + }), arr); return v.contents; } @@ -75,8 +75,8 @@ function for_6(x, u) { contents: 0 }; var arr = $$Array.map((function (param, param$1) { - - }), x); + + }), x); var v4 = { contents: 0 }; @@ -96,17 +96,17 @@ function for_6(x, u) { var h = (v5.contents << 1); v2.contents = v2.contents + 1 | 0; Caml_array.set(arr, i, (function(k,h){ - return function (param) { - v.contents = (((((v.contents + k | 0) + v2.contents | 0) + v4.contents | 0) + v5.contents | 0) + h | 0) + u | 0; - } - }(k,h))); + return function (param) { + v.contents = (((((v.contents + k | 0) + v2.contents | 0) + v4.contents | 0) + v5.contents | 0) + h | 0) + u | 0; + } + }(k,h))); } }(v2)); inspect_3 = v2.contents; } $$Array.iter((function (x) { - Curry._1(x, undefined); - }), arr); + Curry._1(x, undefined); + }), arr); return [ v.contents, v4.contents, @@ -120,22 +120,22 @@ function for_7(param) { contents: 0 }; var arr = Caml_array.make(21, (function (param) { - - })); + + })); for(var i = 0; i <= 6; ++i){ (function(i){ for(var j = 0; j <= 2; ++j){ Caml_array.set(arr, Math.imul(i, 3) + j | 0, (function(j){ - return function (param) { - v.contents = (v.contents + i | 0) + j | 0; - } - }(j))); + return function (param) { + v.contents = (v.contents + i | 0) + j | 0; + } + }(j))); } }(i)); } $$Array.iter((function (f) { - Curry._1(f, undefined); - }), arr); + Curry._1(f, undefined); + }), arr); return v.contents; } @@ -144,24 +144,24 @@ function for_8(param) { contents: 0 }; var arr = Caml_array.make(21, (function (param) { - - })); + + })); for(var i = 0; i <= 6; ++i){ var k = (i << 1); (function(i,k){ for(var j = 0; j <= 2; ++j){ var h = i + j | 0; Caml_array.set(arr, Math.imul(i, 3) + j | 0, (function(j,h){ - return function (param) { - v.contents = (((v.contents + i | 0) + j | 0) + h | 0) + k | 0; - } - }(j,h))); + return function (param) { + v.contents = (((v.contents + i | 0) + j | 0) + h | 0) + k | 0; + } + }(j,h))); } }(i,k)); } $$Array.iter((function (f) { - Curry._1(f, undefined); - }), arr); + Curry._1(f, undefined); + }), arr); return v.contents; } @@ -182,11 +182,11 @@ function for_9(param) { contents: 0 }; var arr = Caml_array.make(4, (function (param) { - - })); + + })); var arr2 = Caml_array.make(2, (function (param) { - - })); + + })); for(var i = 0; i <= 1; ++i){ var v$1 = { contents: 0 @@ -197,22 +197,22 @@ function for_9(param) { v$1.contents = v$1.contents + 1 | 0; collect(v$1.contents); Caml_array.set(arr, (i << 1) + j | 0, (function (param) { - vv.contents = vv.contents + v$1.contents | 0; - })); + vv.contents = vv.contents + v$1.contents | 0; + })); } }(v$1)); Caml_array.set(arr2, i, (function(v$1){ - return function (param) { - vv2.contents = vv2.contents + v$1.contents | 0; - } - }(v$1))); + return function (param) { + vv2.contents = vv2.contents + v$1.contents | 0; + } + }(v$1))); } $$Array.iter((function (f) { - Curry._1(f, undefined); - }), arr); + Curry._1(f, undefined); + }), arr); $$Array.iter((function (f) { - Curry._1(f, undefined); - }), arr2); + Curry._1(f, undefined); + }), arr2); return [[ vv.contents, $$Array.of_list(List.rev(v.contents)), @@ -223,93 +223,93 @@ function for_9(param) { var suites_0 = [ "for_loop_test_3", (function (param) { - return { - TAG: "Eq", - _0: 90, - _1: for_3(Caml_array.make(10, 2)) - }; - }) + return { + TAG: "Eq", + _0: 90, + _1: for_3(Caml_array.make(10, 2)) + }; + }) ]; var suites_1 = { hd: [ "for_loop_test_4", (function (param) { - return { - TAG: "Eq", - _0: 180, - _1: for_4(Caml_array.make(10, 2)) - }; - }) + return { + TAG: "Eq", + _0: 180, + _1: for_4(Caml_array.make(10, 2)) + }; + }) ], tl: { hd: [ "for_loop_test_5", (function (param) { - return { - TAG: "Eq", - _0: 2420, - _1: for_5(Caml_array.make(10, 2), 11) - }; - }) + return { + TAG: "Eq", + _0: 2420, + _1: for_5(Caml_array.make(10, 2), 11) + }; + }) ], tl: { hd: [ "for_loop_test_6", (function (param) { - return { - TAG: "Eq", - _0: [ - 30, - 1, - 2, - 3 - ], - _1: for_6(Caml_array.make(3, 0), 0) - }; - }) + return { + TAG: "Eq", + _0: [ + 30, + 1, + 2, + 3 + ], + _1: for_6(Caml_array.make(3, 0), 0) + }; + }) ], tl: { hd: [ "for_loop_test_7", (function (param) { - return { - TAG: "Eq", - _0: 84, - _1: for_7() - }; - }) + return { + TAG: "Eq", + _0: 84, + _1: for_7() + }; + }) ], tl: { hd: [ "for_loop_test_8", (function (param) { - return { - TAG: "Eq", - _0: 294, - _1: for_8() - }; - }) + return { + TAG: "Eq", + _0: 294, + _1: for_8() + }; + }) ], tl: { hd: [ "for_loop_test_9", (function (param) { - return { - TAG: "Eq", - _0: [[ - 10, - [ - 1, - 2, - 2, - 3 - ], - 5 - ]], - _1: for_9() - }; - }) + return { + TAG: "Eq", + _0: [[ + 10, + [ + 1, + 2, + 2, + 3 + ], + 5 + ]], + _1: for_9() + }; + }) ], tl: /* [] */0 } diff --git a/jscomp/test/for_side_effect_test.js b/jscomp/test/for_side_effect_test.js index 8e0ed3cb60..821bd79b79 100644 --- a/jscomp/test/for_side_effect_test.js +++ b/jscomp/test/for_side_effect_test.js @@ -22,12 +22,12 @@ function test2(param) { var suites_0 = [ "for_order", (function (param) { - return { - TAG: "Eq", - _0: 10, - _1: test2() - }; - }) + return { + TAG: "Eq", + _0: 10, + _1: test2() + }; + }) ]; var suites = { diff --git a/jscomp/test/format_test.js b/jscomp/test/format_test.js index e3602f80fe..041603ffc7 100644 --- a/jscomp/test/format_test.js +++ b/jscomp/test/format_test.js @@ -21,12 +21,12 @@ function eq(loc, x, y) { hd: [ loc + (" id " + String(test_id.contents)), (function (param) { - return { - TAG: "Eq", - _0: x, - _1: y - }; - }) + return { + TAG: "Eq", + _0: x, + _1: y + }; + }) ], tl: suites.contents }; @@ -78,29 +78,29 @@ eq("File \"format_test.res\", line 46, characters 5-12", (1 + 65535 / 65536) * 8 function f(loc, ls) { List.iter((function (param) { - eq(loc, Caml_format.float_of_string(param[0]), param[1]); - }), ls); + eq(loc, Caml_format.float_of_string(param[0]), param[1]); + }), ls); } f("File \"format_test.res\", line 53, characters 11-18", { + hd: [ + "0x3.fp+1", + 7.875 + ], + tl: { + hd: [ + " 0x3.fp2", + 15.75 + ], + tl: { hd: [ - "0x3.fp+1", - 7.875 + " 0x4.fp2", + 19.75 ], - tl: { - hd: [ - " 0x3.fp2", - 15.75 - ], - tl: { - hd: [ - " 0x4.fp2", - 19.75 - ], - tl: /* [] */0 - } - } - }); + tl: /* [] */0 + } + } +}); function sl(f) { return Caml_format.hexstring_of_float(f, -1, /* '-' */45); @@ -108,8 +108,8 @@ function sl(f) { function aux_list(loc, ls) { List.iter((function (param) { - eq(loc, Caml_format.hexstring_of_float(param[0], -1, /* '-' */45), param[1]); - }), ls); + eq(loc, Caml_format.hexstring_of_float(param[0], -1, /* '-' */45), param[1]); + }), ls); } var literals_0 = [ @@ -187,8 +187,8 @@ scan_float("File \"format_test.res\", line 80, characters 13-20", "0x3f.p1", 126 scan_float("File \"format_test.res\", line 81, characters 13-20", "0x1.3333333333333p-2", 0.3); List.iter((function (param) { - scan_float("File \"format_test.res\", line 82, characters 35-42", param[1], param[0]); - }), literals); + scan_float("File \"format_test.res\", line 82, characters 35-42", param[1], param[0]); +}), literals); var f1 = - -9.9; diff --git a/jscomp/test/fun_pattern_match.js b/jscomp/test/fun_pattern_match.js index 2b143273d3..dd57ac1a15 100644 --- a/jscomp/test/fun_pattern_match.js +++ b/jscomp/test/fun_pattern_match.js @@ -85,9 +85,9 @@ function handle_tuple(x, y) { return 2; } console.log([ - x, - y - ]); + x, + y + ]); return x + y | 0; } diff --git a/jscomp/test/functor_app_test.js b/jscomp/test/functor_app_test.js index 2de9a59f61..6305fc7ab7 100644 --- a/jscomp/test/functor_app_test.js +++ b/jscomp/test/functor_app_test.js @@ -20,12 +20,12 @@ function eq(loc, x, y) { hd: [ loc + (" id " + String(test_id.contents)), (function (param) { - return { - TAG: "Eq", - _0: x, - _1: y - }; - }) + return { + TAG: "Eq", + _0: x, + _1: y + }; + }) ], tl: suites.contents }; diff --git a/jscomp/test/functors.js b/jscomp/test/functors.js index f1487cdd44..cd42b3af76 100644 --- a/jscomp/test/functors.js +++ b/jscomp/test/functors.js @@ -49,13 +49,13 @@ function F2(X, Y) { var M = { F: (function (funarg, funarg$1) { - var sheep = function (x) { - return 1 + Curry._1(funarg$1.foo, Curry._1(funarg.foo, x)) | 0; - }; - return { - sheep: sheep - }; - }) + var sheep = function (x) { + return 1 + Curry._1(funarg$1.foo, Curry._1(funarg.foo, x)) | 0; + }; + return { + sheep: sheep + }; + }) }; exports.O = O; diff --git a/jscomp/test/genlex_test.js b/jscomp/test/genlex_test.js index 6c043ca4ce..3fcefd3b65 100644 --- a/jscomp/test/genlex_test.js +++ b/jscomp/test/genlex_test.js @@ -8,30 +8,30 @@ var Stream = require("../../lib/js/stream.js"); var Caml_js_exceptions = require("../../lib/js/caml_js_exceptions.js"); var lexer = Genlex.make_lexer({ - hd: "+", + hd: "+", + tl: { + hd: "-", + tl: { + hd: "*", tl: { - hd: "-", + hd: "/", tl: { - hd: "*", + hd: "let", tl: { - hd: "/", + hd: "=", tl: { - hd: "let", + hd: "(", tl: { - hd: "=", - tl: { - hd: "(", - tl: { - hd: ")", - tl: /* [] */0 - } - } + hd: ")", + tl: /* [] */0 } } } } } - }); + } + } +}); function to_list(s) { var _acc = /* [] */0; @@ -59,54 +59,54 @@ function to_list(s) { var suites_0 = [ "lexer_stream_genlex", (function (param) { - return { - TAG: "Eq", - _0: { + return { + TAG: "Eq", + _0: { + hd: { + TAG: "Int", + _0: 3 + }, + tl: { hd: { - TAG: "Int", - _0: 3 + TAG: "Kwd", + _0: "(" }, tl: { hd: { - TAG: "Kwd", - _0: "(" + TAG: "Int", + _0: 3 }, tl: { hd: { - TAG: "Int", - _0: 3 + TAG: "Kwd", + _0: "+" }, tl: { hd: { - TAG: "Kwd", - _0: "+" + TAG: "Int", + _0: 2 }, tl: { hd: { TAG: "Int", - _0: 2 + _0: -1 }, tl: { hd: { - TAG: "Int", - _0: -1 + TAG: "Kwd", + _0: ")" }, - tl: { - hd: { - TAG: "Kwd", - _0: ")" - }, - tl: /* [] */0 - } + tl: /* [] */0 } } } } } - }, - _1: to_list(lexer(Stream.of_string("3(3 + 2 -1)"))) - }; - }) + } + }, + _1: to_list(lexer(Stream.of_string("3(3 + 2 -1)"))) + }; + }) ]; var suites = { diff --git a/jscomp/test/global_exception_regression_test.js b/jscomp/test/global_exception_regression_test.js index efabf98f12..22b914151a 100644 --- a/jscomp/test/global_exception_regression_test.js +++ b/jscomp/test/global_exception_regression_test.js @@ -18,24 +18,24 @@ var s = { var suites_0 = [ "not_found_equal", (function (param) { - return { - TAG: "Eq", - _0: u, - _1: v - }; - }) + return { + TAG: "Eq", + _0: u, + _1: v + }; + }) ]; var suites_1 = { hd: [ "not_found_not_equal_end_of_file", (function (param) { - return { - TAG: "Neq", - _0: u, - _1: s - }; - }) + return { + TAG: "Neq", + _0: u, + _1: s + }; + }) ], tl: /* [] */0 }; diff --git a/jscomp/test/global_module_alias_test.js b/jscomp/test/global_module_alias_test.js index 31d17ca13a..34ecd12089 100644 --- a/jscomp/test/global_module_alias_test.js +++ b/jscomp/test/global_module_alias_test.js @@ -19,12 +19,12 @@ function eq(loc, x, y) { hd: [ loc + (" id " + String(test_id.contents)), (function (param) { - return { - TAG: "Eq", - _0: x, - _1: y - }; - }) + return { + TAG: "Eq", + _0: x, + _1: y + }; + }) ], tl: suites.contents }; @@ -52,12 +52,12 @@ function f(param) { } eq("File \"global_module_alias_test.res\", line 48, characters 12-19", List.length({ - hd: 1, - tl: { - hd: 2, - tl: /* [] */0 - } - }), 2); + hd: 1, + tl: { + hd: 2, + tl: /* [] */0 + } +}), 2); v.contents = v.contents + 1 | 0; @@ -89,18 +89,18 @@ eq("File \"global_module_alias_test.res\", line 52, characters 12-19", v.content function g(param) { return List.length({ - hd: 1, + hd: 1, + tl: { + hd: 2, + tl: { + hd: 3, tl: { - hd: 2, - tl: { - hd: 3, - tl: { - hd: 4, - tl: /* [] */0 - } - } + hd: 4, + tl: /* [] */0 } - }); + } + } + }); } function xx(param) { @@ -115,27 +115,27 @@ eq("File \"global_module_alias_test.res\", line 80, characters 12-19", g(), 4); var V = xx(); eq("File \"global_module_alias_test.res\", line 84, characters 5-12", Curry._1(V.length, { - hd: 1, - tl: { - hd: 2, - tl: { - hd: 3, - tl: /* [] */0 - } - } - }), 3); + hd: 1, + tl: { + hd: 2, + tl: { + hd: 3, + tl: /* [] */0 + } + } +}), 3); eq("File \"global_module_alias_test.res\", line 85, characters 5-12", v.contents, 15); var H$1 = f(); eq("File \"global_module_alias_test.res\", line 87, characters 5-12", Curry._1(H$1.length, { - hd: 1, - tl: { - hd: 2, - tl: /* [] */0 - } - }), 2); + hd: 1, + tl: { + hd: 2, + tl: /* [] */0 + } +}), 2); eq("File \"global_module_alias_test.res\", line 88, characters 5-12", v.contents, 21); diff --git a/jscomp/test/google_closure_test.js b/jscomp/test/google_closure_test.js index 0083eab47a..254ae291cb 100644 --- a/jscomp/test/google_closure_test.js +++ b/jscomp/test/google_closure_test.js @@ -5,28 +5,28 @@ var Mt = require("./mt.js"); var Test_google_closure = require("./test_google_closure.js"); Mt.from_pair_suites("Closure", { - hd: [ - "partial", - (function (param) { - return { - TAG: "Eq", - _0: [ - Test_google_closure.a, - Test_google_closure.b, - Test_google_closure.c - ], - _1: [ - "3", - 101, - [ - 1, - 2 - ] - ] - }; - }) - ], - tl: /* [] */0 - }); + hd: [ + "partial", + (function (param) { + return { + TAG: "Eq", + _0: [ + Test_google_closure.a, + Test_google_closure.b, + Test_google_closure.c + ], + _1: [ + "3", + 101, + [ + 1, + 2 + ] + ] + }; + }) + ], + tl: /* [] */0 +}); /* Not a pure module */ diff --git a/jscomp/test/gpr496_test.js b/jscomp/test/gpr496_test.js index 6fd8217bc7..afc9f6e9d3 100644 --- a/jscomp/test/gpr496_test.js +++ b/jscomp/test/gpr496_test.js @@ -19,12 +19,12 @@ function eq(loc, x, y) { hd: [ loc + (" id " + String(test_id.contents)), (function (param) { - return { - TAG: "Eq", - _0: x, - _1: y - }; - }) + return { + TAG: "Eq", + _0: x, + _1: y + }; + }) ], tl: suites.contents }; diff --git a/jscomp/test/gpr_1154_test.js b/jscomp/test/gpr_1154_test.js index 7ccf80d051..87e2a46b10 100644 --- a/jscomp/test/gpr_1154_test.js +++ b/jscomp/test/gpr_1154_test.js @@ -19,12 +19,12 @@ function eq(loc, x, y) { hd: [ loc + (" id " + String(test_id.contents)), (function (param) { - return { - TAG: "Eq", - _0: x, - _1: y - }; - }) + return { + TAG: "Eq", + _0: x, + _1: y + }; + }) ], tl: suites.contents }; diff --git a/jscomp/test/gpr_1409_test.js b/jscomp/test/gpr_1409_test.js index 51a334deb7..5c1c015870 100644 --- a/jscomp/test/gpr_1409_test.js +++ b/jscomp/test/gpr_1409_test.js @@ -21,12 +21,12 @@ function eq(loc, x, y) { hd: [ loc + (" id " + String(test_id.contents)), (function (param) { - return { - TAG: "Eq", - _0: x, - _1: y - }; - }) + return { + TAG: "Eq", + _0: x, + _1: y + }; + }) ], tl: suites.contents }; @@ -47,8 +47,8 @@ function map(f, x) { function make(foo) { var partial_arg = map((function (prim) { - return String(prim); - }), foo); + return String(prim); + }), foo); return function (param) { var tmp = {}; if (partial_arg !== undefined) { @@ -139,28 +139,28 @@ function keys(xs, ys) { } eq("File \"gpr_1409_test.res\", line 69, characters 3-10", keys({ - hd: "hi", - tl: /* [] */0 - }, Object.keys(test3(undefined, undefined))), true); + hd: "hi", + tl: /* [] */0 +}, Object.keys(test3(undefined, undefined))), true); eq("File \"gpr_1409_test.res\", line 71, characters 3-10", keys({ - hd: "hi", - tl: { - hd: "_open", - tl: /* [] */0 - } - }, Object.keys(test3(2, undefined))), true); + hd: "hi", + tl: { + hd: "_open", + tl: /* [] */0 + } +}, Object.keys(test3(2, undefined))), true); eq("File \"gpr_1409_test.res\", line 73, characters 3-10", keys({ - hd: "hi", - tl: { - hd: "_open", - tl: { - hd: "xx__hi", - tl: /* [] */0 - } - } - }, Object.keys(test3(2, 2))), true); + hd: "hi", + tl: { + hd: "_open", + tl: { + hd: "xx__hi", + tl: /* [] */0 + } + } +}, Object.keys(test3(2, 2))), true); Mt.from_pair_suites("Gpr_1409_test", suites.contents); diff --git a/jscomp/test/gpr_1423_app_test.js b/jscomp/test/gpr_1423_app_test.js index f4af92b57b..4cfc400ade 100644 --- a/jscomp/test/gpr_1423_app_test.js +++ b/jscomp/test/gpr_1423_app_test.js @@ -19,12 +19,12 @@ function eq(loc, x, y) { hd: [ loc + (" id " + String(test_id.contents)), (function (param) { - return { - TAG: "Eq", - _0: x, - _1: y - }; - }) + return { + TAG: "Eq", + _0: x, + _1: y + }; + }) ], tl: suites.contents }; @@ -35,10 +35,10 @@ function foo(f) { } foo(function (param) { - return function (param$1) { - return Gpr_1423_nav.busted(param, "a2", param$1); - }; - }); + return function (param$1) { + return Gpr_1423_nav.busted(param, "a2", param$1); + }; +}); function foo2(f) { return Curry._2(f, "a1", undefined); diff --git a/jscomp/test/gpr_1503_test.js b/jscomp/test/gpr_1503_test.js index 20a78ce5b9..4700978982 100644 --- a/jscomp/test/gpr_1503_test.js +++ b/jscomp/test/gpr_1503_test.js @@ -20,12 +20,12 @@ function eq(loc, x, y) { hd: [ loc + (" id " + String(test_id.contents)), (function (param) { - return { - TAG: "Eq", - _0: x, - _1: y - }; - }) + return { + TAG: "Eq", + _0: x, + _1: y + }; + }) ], tl: suites.contents }; diff --git a/jscomp/test/gpr_1539_test.js b/jscomp/test/gpr_1539_test.js index a0d64fd637..e1a1e4e264 100644 --- a/jscomp/test/gpr_1539_test.js +++ b/jscomp/test/gpr_1539_test.js @@ -4,28 +4,28 @@ var Caml_module = require("../../lib/js/caml_module.js"); var Point = Caml_module.init_mod([ - "gpr_1539_test.res", - 11, - 4 - ], { - TAG: "Module", - _0: [[ - "Function", - "add" - ]] - }); + "gpr_1539_test.res", + 11, + 4 +], { + TAG: "Module", + _0: [[ + "Function", + "add" + ]] +}); Caml_module.update_mod({ - TAG: "Module", - _0: [[ - "Function", - "add" - ]] - }, Point, { - add: (function (prim0, prim1) { - return prim0.add(prim1); - }) - }); + TAG: "Module", + _0: [[ + "Function", + "add" + ]] +}, Point, { + add: (function (prim0, prim1) { + return prim0.add(prim1); + }) +}); var CRS; diff --git a/jscomp/test/gpr_1658_test.js b/jscomp/test/gpr_1658_test.js index 9617511d97..8e88ca028e 100644 --- a/jscomp/test/gpr_1658_test.js +++ b/jscomp/test/gpr_1658_test.js @@ -18,12 +18,12 @@ function eq(loc, x, y) { hd: [ loc + (" id " + String(test_id.contents)), (function (param) { - return { - TAG: "Eq", - _0: x, - _1: y - }; - }) + return { + TAG: "Eq", + _0: x, + _1: y + }; + }) ], tl: suites.contents }; diff --git a/jscomp/test/gpr_1667_test.js b/jscomp/test/gpr_1667_test.js index 53f9750c9b..45e135779c 100644 --- a/jscomp/test/gpr_1667_test.js +++ b/jscomp/test/gpr_1667_test.js @@ -17,12 +17,12 @@ function eq(loc, x, y) { hd: [ loc + (" id " + String(test_id.contents)), (function (param) { - return { - TAG: "Eq", - _0: x, - _1: y - }; - }) + return { + TAG: "Eq", + _0: x, + _1: y + }; + }) ], tl: suites.contents }; diff --git a/jscomp/test/gpr_1698_test.js b/jscomp/test/gpr_1698_test.js index 4c0e82d63e..df96e7f21a 100644 --- a/jscomp/test/gpr_1698_test.js +++ b/jscomp/test/gpr_1698_test.js @@ -216,7 +216,7 @@ var b = { }; console.log(compare("InSum", { - complex: true - }, a, b)); + complex: true +}, a, b)); /* Not a pure module */ diff --git a/jscomp/test/gpr_1701_test.js b/jscomp/test/gpr_1701_test.js index 28680f6b51..7a3cec5153 100644 --- a/jscomp/test/gpr_1701_test.js +++ b/jscomp/test/gpr_1701_test.js @@ -83,9 +83,9 @@ function read_lines3(inc) { try { var l = input_line(inc); return loop({ - hd: l, - tl: acc - }); + hd: l, + tl: acc + }); } catch (raw_exn){ var exn = Caml_js_exceptions.internalToOCamlException(raw_exn); diff --git a/jscomp/test/gpr_1716_test.js b/jscomp/test/gpr_1716_test.js index 6609115ee4..89a927beb1 100644 --- a/jscomp/test/gpr_1716_test.js +++ b/jscomp/test/gpr_1716_test.js @@ -18,12 +18,12 @@ function eq(loc, x, y) { hd: [ loc + (" id " + String(test_id.contents)), (function (param) { - return { - TAG: "Eq", - _0: x, - _1: y - }; - }) + return { + TAG: "Eq", + _0: x, + _1: y + }; + }) ], tl: suites.contents }; @@ -34,12 +34,12 @@ var a = {}; var b = {}; Caml_obj.update_dummy(a, { - b: b - }); + b: b +}); Caml_obj.update_dummy(b, { - a: a - }); + a: a +}); function is_inifite(x) { return x.b.a === x; diff --git a/jscomp/test/gpr_1728_test.js b/jscomp/test/gpr_1728_test.js index 9e74e97606..8beb12eb96 100644 --- a/jscomp/test/gpr_1728_test.js +++ b/jscomp/test/gpr_1728_test.js @@ -18,12 +18,12 @@ function eq(loc, x, y) { hd: [ loc + (" id " + String(test_id.contents)), (function (param) { - return { - TAG: "Eq", - _0: x, - _1: y - }; - }) + return { + TAG: "Eq", + _0: x, + _1: y + }; + }) ], tl: suites.contents }; @@ -39,8 +39,8 @@ function badInlining(obj) { } eq("File \"gpr_1728_test.res\", line 16, characters 3-10", badInlining({ - field: "3" - }), undefined); + field: "3" +}), undefined); eq("File \"gpr_1728_test.res\", line 18, characters 3-10", Caml_format.int_of_string("-13"), -13); diff --git a/jscomp/test/gpr_1749_test.js b/jscomp/test/gpr_1749_test.js index 7339ca80af..2ef3e7f6fd 100644 --- a/jscomp/test/gpr_1749_test.js +++ b/jscomp/test/gpr_1749_test.js @@ -17,12 +17,12 @@ function eq(loc, x, y) { hd: [ loc + (" id " + String(test_id.contents)), (function (param) { - return { - TAG: "Eq", - _0: x, - _1: y - }; - }) + return { + TAG: "Eq", + _0: x, + _1: y + }; + }) ], tl: suites.contents }; diff --git a/jscomp/test/gpr_1760_test.js b/jscomp/test/gpr_1760_test.js index f71a0f5a5d..552398ce6c 100644 --- a/jscomp/test/gpr_1760_test.js +++ b/jscomp/test/gpr_1760_test.js @@ -19,12 +19,12 @@ function eq(loc, x, y) { hd: [ loc + (" id " + String(test_id.contents)), (function (param) { - return { - TAG: "Eq", - _0: x, - _1: y - }; - }) + return { + TAG: "Eq", + _0: x, + _1: y + }; + }) ], tl: suites.contents }; @@ -91,20 +91,20 @@ catch (exn$5){ } eq("File \"gpr_1760_test.res\", line 57, characters 3-10", [ - a0, - a1, - a4, - a5, - a6, - a7 - ], [ - 1, - 1, - 1, - 1, - 1, - 1 - ]); + a0, + a1, + a4, + a5, + a6, + a7 +], [ + 1, + 1, + 1, + 1, + 1, + 1 +]); Mt.from_pair_suites("Gpr_1760_test", suites.contents); diff --git a/jscomp/test/gpr_1762_test.js b/jscomp/test/gpr_1762_test.js index ee69f71d1d..06965afd85 100644 --- a/jscomp/test/gpr_1762_test.js +++ b/jscomp/test/gpr_1762_test.js @@ -17,12 +17,12 @@ function eq(loc, x, y) { hd: [ loc + (" id " + String(test_id.contents)), (function (param) { - return { - TAG: "Eq", - _0: x, - _1: y - }; - }) + return { + TAG: "Eq", + _0: x, + _1: y + }; + }) ], tl: suites.contents }; diff --git a/jscomp/test/gpr_1817_test.js b/jscomp/test/gpr_1817_test.js index 7631b46e00..587c30c787 100644 --- a/jscomp/test/gpr_1817_test.js +++ b/jscomp/test/gpr_1817_test.js @@ -18,12 +18,12 @@ function eq(loc, x, y) { hd: [ loc + (" id " + String(test_id.contents)), (function (param) { - return { - TAG: "Eq", - _0: x, - _1: y - }; - }) + return { + TAG: "Eq", + _0: x, + _1: y + }; + }) ], tl: suites.contents }; diff --git a/jscomp/test/gpr_1822_test.js b/jscomp/test/gpr_1822_test.js index 358cf5ef37..73e2c7fada 100644 --- a/jscomp/test/gpr_1822_test.js +++ b/jscomp/test/gpr_1822_test.js @@ -17,12 +17,12 @@ function eq(loc, x, y) { hd: [ loc + (" id " + String(test_id.contents)), (function (param) { - return { - TAG: "Eq", - _0: x, - _1: y - }; - }) + return { + TAG: "Eq", + _0: x, + _1: y + }; + }) ], tl: suites.contents }; diff --git a/jscomp/test/gpr_1943_test.js b/jscomp/test/gpr_1943_test.js index 39925d9b25..5e84fee2fd 100644 --- a/jscomp/test/gpr_1943_test.js +++ b/jscomp/test/gpr_1943_test.js @@ -17,12 +17,12 @@ function eq(loc, x, y) { hd: [ loc + (" id " + String(test_id.contents)), (function (param) { - return { - TAG: "Eq", - _0: x, - _1: y - }; - }) + return { + TAG: "Eq", + _0: x, + _1: y + }; + }) ], tl: suites.contents }; @@ -41,24 +41,24 @@ function f(x) { } var v = f({ - _003: 0, - _50: 1, - _50x: 2, - __50: 3, - __50x: 4, - "_50x'": 5, - "x'": 6 - }); + _003: 0, + _50: 1, + _50x: 2, + __50: 3, + __50x: 4, + "_50x'": 5, + "x'": 6 +}); eq("File \"gpr_1943_test.res\", line 23, characters 3-10", [ - 0, - 1, - 2, - 3, - 4, - 5, - 6 - ], v); + 0, + 1, + 2, + 3, + 4, + 5, + 6 +], v); Mt.from_pair_suites("Gpr_1943_test", suites.contents); diff --git a/jscomp/test/gpr_1946_test.js b/jscomp/test/gpr_1946_test.js index 04b2be9dc7..50553a00ce 100644 --- a/jscomp/test/gpr_1946_test.js +++ b/jscomp/test/gpr_1946_test.js @@ -37,20 +37,20 @@ function f(id) { } eq("File \"gpr_1946_test.res\", line 24, characters 3-10", ({ - _5: 3 - })._5, 3); + _5: 3 +})._5, 3); eq("File \"gpr_1946_test.res\", line 25, characters 3-10", [ - 2, - 3 - ], [ - f(h)["0123"], - f(h)["123_456"] - ]); + 2, + 3 +], [ + f(h)["0123"], + f(h)["123_456"] +]); console.log(({ - _5: 3 - }).TAG); + _5: 3 + }).TAG); Mt.from_pair_suites("File \"gpr_1946_test.res\", line 28, characters 20-27", suites.contents); diff --git a/jscomp/test/gpr_2316_test.js b/jscomp/test/gpr_2316_test.js index c24b83d40f..54e85ae658 100644 --- a/jscomp/test/gpr_2316_test.js +++ b/jscomp/test/gpr_2316_test.js @@ -18,12 +18,12 @@ function eq(loc, x, y) { hd: [ loc + (" id " + String(test_id.contents)), (function (param) { - return { - TAG: "Eq", - _0: x, - _1: y - }; - }) + return { + TAG: "Eq", + _0: x, + _1: y + }; + }) ], tl: suites.contents }; diff --git a/jscomp/test/gpr_2487.js b/jscomp/test/gpr_2487.js index 6bf5991877..ed12c34597 100644 --- a/jscomp/test/gpr_2487.js +++ b/jscomp/test/gpr_2487.js @@ -4,16 +4,16 @@ var Belt_Array = require("../../lib/js/belt_Array.js"); var b = Belt_Array.eq([ - 1, - 2, - 3 - ], [ - 1, - 2, - 3 - ], (function (prim0, prim1) { - return prim0 === prim1; - })); + 1, + 2, + 3 +], [ + 1, + 2, + 3 +], (function (prim0, prim1) { + return prim0 === prim1; +})); var A; diff --git a/jscomp/test/gpr_2503_test.js b/jscomp/test/gpr_2503_test.js index 8b2be590ce..423b6b4fb0 100644 --- a/jscomp/test/gpr_2503_test.js +++ b/jscomp/test/gpr_2503_test.js @@ -30,8 +30,8 @@ function makeWrapper(foo, param) { function makeWrapper2(foo, param) { console.log({ - foo: foo - }); + foo: foo + }); } makeWrapper2("a", undefined); diff --git a/jscomp/test/gpr_2608_test.js b/jscomp/test/gpr_2608_test.js index 4a67676901..e52f8e6c4f 100644 --- a/jscomp/test/gpr_2608_test.js +++ b/jscomp/test/gpr_2608_test.js @@ -25,8 +25,8 @@ var huntGrootCondition = false; if (List.length(/* [] */0) > 0) { var x = List.filter(function (h) { - return List.hd(/* [] */0) <= 1000; - })(oppHeroes); + return List.hd(/* [] */0) <= 1000; + })(oppHeroes); huntGrootCondition = List.length(x) === 0; } @@ -34,8 +34,8 @@ var huntGrootCondition2 = true; if (List.length(/* [] */0) < 0) { var x$1 = List.filter(function (h) { - return List.hd(/* [] */0) <= 1000; - })(oppHeroes); + return List.hd(/* [] */0) <= 1000; + })(oppHeroes); huntGrootCondition2 = List.length(x$1) === 0; } diff --git a/jscomp/test/gpr_2682_test.js b/jscomp/test/gpr_2682_test.js index c66058c9e5..437d296fba 100644 --- a/jscomp/test/gpr_2682_test.js +++ b/jscomp/test/gpr_2682_test.js @@ -29,17 +29,17 @@ var N = { }; forIn({ - x: 3 - }, (function (x) { - console.log(x); - })); + x: 3 +}, (function (x) { + console.log(x); +})); forIn({ - x: 3, - y: 3 - }, (function (x) { - console.log(x); - })); + x: 3, + y: 3 +}, (function (x) { + console.log(x); +})); var f3 = (()=>true); diff --git a/jscomp/test/gpr_3536_test.js b/jscomp/test/gpr_3536_test.js index 15958cab58..7f8f93ca2e 100644 --- a/jscomp/test/gpr_3536_test.js +++ b/jscomp/test/gpr_3536_test.js @@ -25,12 +25,12 @@ function xx(obj, a0, a1, a2, a3, a4, a5) { eq("File \"gpr_3536_test.res\", line 18, characters 12-19", 5, 5); eq("File \"gpr_3536_test.res\", line 20, characters 12-19", xx(3, (function (prim0, prim1) { - return prim0 - prim1 | 0; - }), 2, (function (prim0, prim1) { - return prim0 + prim1 | 0; - }), 4, (function (prim0, prim1) { - return Math.imul(prim0, prim1); - }), 3), 11); + return prim0 - prim1 | 0; +}), 2, (function (prim0, prim1) { + return prim0 + prim1 | 0; +}), 4, (function (prim0, prim1) { + return Math.imul(prim0, prim1); +}), 3), 11); Mt.from_pair_suites("Gpr_3536_test", suites.contents); diff --git a/jscomp/test/gpr_3549_test.js b/jscomp/test/gpr_3549_test.js index 264e5121a3..5146f21fa6 100644 --- a/jscomp/test/gpr_3549_test.js +++ b/jscomp/test/gpr_3549_test.js @@ -32,12 +32,12 @@ eq("File \"gpr_3549_test.res\", line 15, characters 5-12", 0.2, 0.2); eq("File \"gpr_3549_test.res\", line 16, characters 5-12", 32, 32); eq("File \"gpr_3549_test.res\", line 17, characters 5-12", others, [ - 0.0, - 0.0, - 1.0, - 1.0, - 2e3 - ]); + 0.0, + 0.0, + 1.0, + 1.0, + 2e3 +]); Mt.from_pair_suites("Gpr_3549_test", suites.contents); diff --git a/jscomp/test/gpr_3566_test.js b/jscomp/test/gpr_3566_test.js index 893d611bc0..d2a609678f 100644 --- a/jscomp/test/gpr_3566_test.js +++ b/jscomp/test/gpr_3566_test.js @@ -21,9 +21,9 @@ function Test($star) { }; var Block = {}; var b = eq_A({ - TAG: "A", - _0: 3 - }, u); + TAG: "A", + _0: 3 + }, u); return { u: u, Block: Block, @@ -36,12 +36,12 @@ function Test2($star) { console.log("no inline"); var Block = {}; var b = eq_A({ - TAG: "A", - _0: 3 - }, { - TAG: "A", - _0: 3 - }); + TAG: "A", + _0: 3 + }, { + TAG: "A", + _0: 3 + }); return { Block: Block, y: 32, diff --git a/jscomp/test/gpr_3697_test.js b/jscomp/test/gpr_3697_test.js index 80df5b8b79..96a55ee1aa 100644 --- a/jscomp/test/gpr_3697_test.js +++ b/jscomp/test/gpr_3697_test.js @@ -7,8 +7,8 @@ function fix(param) { return { TAG: "Fix", _0: CamlinternalLazy.from_fun(function () { - return fix(); - }) + return fix(); + }) }; } diff --git a/jscomp/test/gpr_3875_test.js b/jscomp/test/gpr_3875_test.js index 17bd77d4ec..3c3c1115d5 100644 --- a/jscomp/test/gpr_3875_test.js +++ b/jscomp/test/gpr_3875_test.js @@ -60,8 +60,8 @@ function eq(loc, x, y) { } compilerBug("x", undefined, true, (function (param) { - return true; - })); + return true; +})); eq("File \"gpr_3875_test.res\", line 35, characters 5-12", result.contents, "Some x, f returns true"); diff --git a/jscomp/test/gpr_3931_test.js b/jscomp/test/gpr_3931_test.js index 627a566ff3..c3c6a9eaf5 100644 --- a/jscomp/test/gpr_3931_test.js +++ b/jscomp/test/gpr_3931_test.js @@ -6,61 +6,61 @@ var Curry = require("../../lib/js/curry.js"); var Caml_module = require("../../lib/js/caml_module.js"); var PA = Caml_module.init_mod([ - "gpr_3931_test.res", - 3, - 4 - ], { - TAG: "Module", - _0: [[ - "Function", - "print" - ]] - }); + "gpr_3931_test.res", + 3, + 4 +], { + TAG: "Module", + _0: [[ + "Function", + "print" + ]] +}); var P = Caml_module.init_mod([ - "gpr_3931_test.res", - 12, - 4 - ], { - TAG: "Module", - _0: [[ - "Function", - "print" - ]] - }); + "gpr_3931_test.res", + 12, + 4 +], { + TAG: "Module", + _0: [[ + "Function", + "print" + ]] +}); function print(a) { $$Array.iter(P.print, a); } Caml_module.update_mod({ - TAG: "Module", - _0: [[ - "Function", - "print" - ]] - }, PA, { - print: print - }); + TAG: "Module", + _0: [[ + "Function", + "print" + ]] +}, PA, { + print: print +}); function print$1(i) { console.log(String(i)); } Caml_module.update_mod({ - TAG: "Module", - _0: [[ - "Function", - "print" - ]] - }, P, { - print: print$1 - }); + TAG: "Module", + _0: [[ + "Function", + "print" + ]] +}, P, { + print: print$1 +}); Curry._1(PA.print, [ - 1, - 2 - ]); + 1, + 2 +]); exports.PA = PA; exports.P = P; diff --git a/jscomp/test/gpr_405_test.js b/jscomp/test/gpr_405_test.js index 2ddc99bb95..c6f7507dd5 100644 --- a/jscomp/test/gpr_405_test.js +++ b/jscomp/test/gpr_405_test.js @@ -9,9 +9,9 @@ var Caml_js_exceptions = require("../../lib/js/caml_js_exceptions.js"); function Make(funarg) { var $$let = funarg.V; var H = Hashtbl.Make({ - equal: $$let.equal, - hash: $$let.hash - }); + equal: $$let.equal, + hash: $$let.hash + }); var find_default = function (htbl, x) { try { return Curry._2(H.find, htbl, x); @@ -74,12 +74,12 @@ function Make(funarg) { var successor = successors.hd; if (!find_default(already_processed, successor)) { return step2(successor, { - hd: [ - top$1, - successors - ], - tl: rest_of_stack$1 - }); + hd: [ + top$1, + successors + ], + tl: rest_of_stack$1 + }); } var x = find_default(on_the_stack, successor) ? Curry._2(H.find, n_labels, successor) : Curry._2(H.find, l_labels, successor); Curry._3(H.add, l_labels, top$1, Caml.int_max(Curry._2(H.find, l_labels, top$1), x)); diff --git a/jscomp/test/gpr_4274_test.js b/jscomp/test/gpr_4274_test.js index 55ce7a2640..9bb8f04c80 100644 --- a/jscomp/test/gpr_4274_test.js +++ b/jscomp/test/gpr_4274_test.js @@ -8,20 +8,20 @@ var N = {}; function f(X, xs) { X.forEach(xs, { - i: (function (x) { - console.log(x.x); - }) - }); + i: (function (x) { + console.log(x.x); + }) + }); } Belt_List.forEachU({ - hd: { - x: 3 - }, - tl: /* [] */0 - }, (function (x) { - console.log(x.x); - })); + hd: { + x: 3 + }, + tl: /* [] */0 +}, (function (x) { + console.log(x.x); +})); var Foo = {}; @@ -30,8 +30,8 @@ var bar = [{ }]; Belt_Array.mapU(bar, (function (b) { - return b.foo; - })); + return b.foo; +})); exports.N = N; exports.f = f; diff --git a/jscomp/test/gpr_4280_test.js b/jscomp/test/gpr_4280_test.js index 2feceec005..2e509a63cd 100644 --- a/jscomp/test/gpr_4280_test.js +++ b/jscomp/test/gpr_4280_test.js @@ -45,9 +45,9 @@ function fn(authState, route) { if (exit === 2) { console.log(authState.VAL); div({ - hd: string("VerifyEmail"), - tl: /* [] */0 - }, undefined); + hd: string("VerifyEmail"), + tl: /* [] */0 + }, undefined); return 2; } @@ -62,41 +62,41 @@ function fn(authState, route) { } else { if (route === "SignUp" || route === "SignIn" || route === "Invite" || route === "PasswordReset") { div({ - hd: string("LoggedOut"), - tl: /* [] */0 - }, undefined); + hd: string("LoggedOut"), + tl: /* [] */0 + }, undefined); return 1; } exit$1 = 2; } if (exit$1 === 2) { div({ - hd: string("Redirect"), - tl: /* [] */0 - }, undefined); + hd: string("Redirect"), + tl: /* [] */0 + }, undefined); return 3; } } console.log(onboardingRoute); div({ - hd: string("Onboarding"), - tl: /* [] */0 - }, undefined); + hd: string("Onboarding"), + tl: /* [] */0 + }, undefined); return 0; } eq("File \"gpr_4280_test.res\", line 42, characters 3-10", fn("Unauthenticated", "Invite"), 1); eq("File \"gpr_4280_test.res\", line 43, characters 3-10", fn("Unauthenticated", { - NAME: "Onboarding", - VAL: 0 - }), 0); + NAME: "Onboarding", + VAL: 0 +}), 0); eq("File \"gpr_4280_test.res\", line 44, characters 3-10", fn({ - NAME: "Unverified", - VAL: 0 - }, "Invite"), 2); + NAME: "Unverified", + VAL: 0 +}, "Invite"), 2); eq("File \"gpr_4280_test.res\", line 45, characters 3-10", fn("Unauthenticated", "xx"), 3); diff --git a/jscomp/test/gpr_459_test.js b/jscomp/test/gpr_459_test.js index 4cd54521cb..357ab5328b 100644 --- a/jscomp/test/gpr_459_test.js +++ b/jscomp/test/gpr_459_test.js @@ -17,12 +17,12 @@ function eq(loc, x, y) { hd: [ loc + (" id " + String(test_id.contents)), (function (param) { - return { - TAG: "Eq", - _0: x, - _1: y - }; - }) + return { + TAG: "Eq", + _0: x, + _1: y + }; + }) ], tl: suites.contents }; @@ -43,14 +43,14 @@ var hh = uu["_'x"]; eq("File \"gpr_459_test.res\", line 23, characters 12-19", hh, 3); eq("File \"gpr_459_test.res\", line 25, characters 12-19", [ - 1, - 2, - 3 - ], [ - uu2._then, - uu2.catch, - uu2["_'x"] - ]); + 1, + 2, + 3 +], [ + uu2._then, + uu2.catch, + uu2["_'x"] +]); Mt.from_pair_suites("Gpr_459_test", suites.contents); diff --git a/jscomp/test/gpr_5218_test.js b/jscomp/test/gpr_5218_test.js index 156aa4b675..878c084c66 100644 --- a/jscomp/test/gpr_5218_test.js +++ b/jscomp/test/gpr_5218_test.js @@ -26,20 +26,20 @@ function test(x) { } Mt.eq_suites(test_id, suites, "File \"gpr_5218_test.res\", line 11, characters 27-34", test({ - NAME: 1, - VAL: 3 - }), { - NAME: 1, - VAL: 3 - }); + NAME: 1, + VAL: 3 +}), { + NAME: 1, + VAL: 3 +}); Mt.eq_suites(test_id, suites, "File \"gpr_5218_test.res\", line 13, characters 27-34", test({ - NAME: 2, - VAL: 3 - }), { - NAME: 2, - VAL: 3 - }); + NAME: 2, + VAL: 3 +}), { + NAME: 2, + VAL: 3 +}); Mt.from_pair_suites("gpr_5218_test.res", suites.contents); diff --git a/jscomp/test/gpr_858_unit2_test.js b/jscomp/test/gpr_858_unit2_test.js index 6b00912b8a..fe549c6e9d 100644 --- a/jscomp/test/gpr_858_unit2_test.js +++ b/jscomp/test/gpr_858_unit2_test.js @@ -5,8 +5,8 @@ var Curry = require("../../lib/js/curry.js"); var delayed = { contents: (function (param) { - - }) + + }) }; for(var i = 1; i <= 2; ++i){ @@ -15,9 +15,9 @@ for(var i = 1; i <= 2; ++i){ if (x !== 0) { var prev = delayed.contents; delayed.contents = (function (param) { - Curry._1(prev, undefined); - f(((n + 1 | 0) + i | 0) - i | 0, x - 1 | 0); - }); + Curry._1(prev, undefined); + f(((n + 1 | 0) + i | 0) - i | 0, x - 1 | 0); + }); return; } if (i === n) { diff --git a/jscomp/test/gpr_904_test.js b/jscomp/test/gpr_904_test.js index 04b25559b3..90a8fda0e8 100644 --- a/jscomp/test/gpr_904_test.js +++ b/jscomp/test/gpr_904_test.js @@ -17,12 +17,12 @@ function eq(loc, x, y) { hd: [ loc + (" id " + String(test_id.contents)), (function (param) { - return { - TAG: "Eq", - _0: x, - _1: y - }; - }) + return { + TAG: "Eq", + _0: x, + _1: y + }; + }) ], tl: suites.contents }; @@ -49,15 +49,15 @@ function f(check) { } eq("File \"gpr_904_test.res\", line 16, characters 12-19", f({ - x: true, - y: false - }), false); + x: true, + y: false +}), false); eq("File \"gpr_904_test.res\", line 18, characters 12-19", check_healty({ - a: false, - b: false, - c: true - }), false); + a: false, + b: false, + c: true +}), false); Mt.from_pair_suites("Gpr_904_test", suites.contents); diff --git a/jscomp/test/gpr_977_test.js b/jscomp/test/gpr_977_test.js index 2760f2f24f..76b608dd58 100644 --- a/jscomp/test/gpr_977_test.js +++ b/jscomp/test/gpr_977_test.js @@ -18,12 +18,12 @@ function eq(loc, x, y) { hd: [ loc + (" id " + String(test_id.contents)), (function (param) { - return { - TAG: "Eq", - _0: x, - _1: y - }; - }) + return { + TAG: "Eq", + _0: x, + _1: y + }; + }) ], tl: suites.contents }; diff --git a/jscomp/test/hash_collision_test.js b/jscomp/test/hash_collision_test.js index 5a6d61003d..edc1a77dec 100644 --- a/jscomp/test/hash_collision_test.js +++ b/jscomp/test/hash_collision_test.js @@ -41,14 +41,14 @@ eq("File \"hash_collision_test.res\", line 20, characters 3-10", 0, 0); eq("File \"hash_collision_test.res\", line 21, characters 3-10", 1, 1); eq("File \"hash_collision_test.res\", line 23, characters 3-10", f1({ - NAME: "Eric_Cooper", - VAL: -1 - }), 0); + NAME: "Eric_Cooper", + VAL: -1 +}), 0); eq("File \"hash_collision_test.res\", line 25, characters 3-10", f1({ - NAME: "azdwbie", - VAL: -2 - }), 0); + NAME: "azdwbie", + VAL: -2 +}), 0); Mt.from_pair_suites("hash_collision_test.res", suites.contents); diff --git a/jscomp/test/hash_test.js b/jscomp/test/hash_test.js index 3695788d90..1abe8a9d8f 100644 --- a/jscomp/test/hash_test.js +++ b/jscomp/test/hash_test.js @@ -23,8 +23,8 @@ function eq(f) { } var test_strings = $$Array.init(32, (function (i) { - return Caml_string.make(i, Char.chr(i)); - })); + return Caml_string.make(i, Char.chr(i)); +})); var test_strings_hash_results = [ 0, diff --git a/jscomp/test/hashtbl_test.js b/jscomp/test/hashtbl_test.js index 9827ded0cb..52861b3083 100644 --- a/jscomp/test/hashtbl_test.js +++ b/jscomp/test/hashtbl_test.js @@ -10,14 +10,14 @@ var MoreLabels = require("../../lib/js/moreLabels.js"); function to_list(tbl) { return Hashtbl.fold((function (k, v, acc) { - return { - hd: [ - k, - v - ], - tl: acc - }; - }), tbl, /* [] */0); + return { + hd: [ + k, + v + ], + tl: acc + }; + }), tbl, /* [] */0); } function f(param) { @@ -25,8 +25,8 @@ function f(param) { Hashtbl.add(tbl, 1, /* '1' */49); Hashtbl.add(tbl, 2, /* '2' */50); return List.sort((function (param, param$1) { - return Caml.int_compare(param[0], param$1[0]); - }), to_list(tbl)); + return Caml.int_compare(param[0], param$1[0]); + }), to_list(tbl)); } function g(count) { @@ -39,61 +39,61 @@ function g(count) { } var v = to_list(tbl); return $$Array.of_list(List.sort((function (param, param$1) { - return Caml.int_compare(param[0], param$1[0]); - }), v)); + return Caml.int_compare(param[0], param$1[0]); + }), v)); } var suites_0 = [ "simple", (function (param) { - return { - TAG: "Eq", - _0: { + return { + TAG: "Eq", + _0: { + hd: [ + 1, + /* '1' */49 + ], + tl: { hd: [ - 1, - /* '1' */49 + 2, + /* '2' */50 ], - tl: { - hd: [ - 2, - /* '2' */50 - ], - tl: /* [] */0 - } - }, - _1: f() - }; - }) + tl: /* [] */0 + } + }, + _1: f() + }; + }) ]; var suites_1 = { hd: [ "more_iterations", (function (param) { - return { - TAG: "Eq", - _0: $$Array.init(1001, (function (i) { - return [ - (i << 1), - String(i) - ]; - })), - _1: g(1000) - }; - }) + return { + TAG: "Eq", + _0: $$Array.init(1001, (function (i) { + return [ + (i << 1), + String(i) + ]; + })), + _1: g(1000) + }; + }) ], tl: { hd: [ "More_labels_regressionfix_374", (function (param) { - var tbl = MoreLabels.Hashtbl.create(undefined, 30); - Hashtbl.add(tbl, 3, 3); - return { - TAG: "Eq", - _0: tbl.size, - _1: 1 - }; - }) + var tbl = MoreLabels.Hashtbl.create(undefined, 30); + Hashtbl.add(tbl, 3, 3); + return { + TAG: "Eq", + _0: tbl.size, + _1: 1 + }; + }) ], tl: /* [] */0 } diff --git a/jscomp/test/hello_res.js b/jscomp/test/hello_res.js index 7c6cdc157b..8853737348 100644 --- a/jscomp/test/hello_res.js +++ b/jscomp/test/hello_res.js @@ -4,37 +4,37 @@ var List = require("../../lib/js/list.js"); var b = List.length({ - hd: 1, - tl: { - hd: 2, - tl: { - hd: 3, - tl: /* [] */0 - } - } - }); + hd: 1, + tl: { + hd: 2, + tl: { + hd: 3, + tl: /* [] */0 + } + } +}); var a = b - 1 | 0; console.log("hello, res"); List.length({ - hd: 1, - tl: { - hd: 2, - tl: { - hd: 3, - tl: /* [] */0 - } - } - }); + hd: 1, + tl: { + hd: 2, + tl: { + hd: 3, + tl: /* [] */0 + } + } +}); console.log(3); console.log([ - 3, - 1 - ]); + 3, + 1 +]); var to = 3; diff --git a/jscomp/test/ignore_test.js b/jscomp/test/ignore_test.js index 602839e99f..99acff62b6 100644 --- a/jscomp/test/ignore_test.js +++ b/jscomp/test/ignore_test.js @@ -17,12 +17,12 @@ function eq(loc, x, y) { hd: [ loc + (" id " + String(test_id.contents)), (function (param) { - return { - TAG: "Eq", - _0: x, - _1: y - }; - }) + return { + TAG: "Eq", + _0: x, + _1: y + }; + }) ], tl: suites.contents }; diff --git a/jscomp/test/imm_map_bench.js b/jscomp/test/imm_map_bench.js index 68033d1241..48c66a4133 100644 --- a/jscomp/test/imm_map_bench.js +++ b/jscomp/test/imm_map_bench.js @@ -24,11 +24,11 @@ function should(b) { } var shuffledDataAdd = Belt_Array.makeByAndShuffle(1000001, (function (i) { - return [ - i, - i - ]; - })); + return [ + i, + i + ]; +})); function test(param) { var v = fromArray(shuffledDataAdd); diff --git a/jscomp/test/import2.js b/jscomp/test/import2.js index 00deaef5c0..b39e596551 100644 --- a/jscomp/test/import2.js +++ b/jscomp/test/import2.js @@ -4,8 +4,8 @@ var A = require("a").default; var a = import("a").then(function (m) { - return m.default; - }); + return m.default; +}); var b = A; diff --git a/jscomp/test/import_external.js b/jscomp/test/import_external.js index 595a8b2358..4b84a859e5 100644 --- a/jscomp/test/import_external.js +++ b/jscomp/test/import_external.js @@ -3,8 +3,8 @@ var f8 = import("a").then(function (m) { - return m.default; - }); + return m.default; +}); exports.f8 = f8; /* f8 Not a pure module */ diff --git a/jscomp/test/import_side_effect.js b/jscomp/test/import_side_effect.js index afe5c54c18..83fbd9d487 100644 --- a/jscomp/test/import_side_effect.js +++ b/jscomp/test/import_side_effect.js @@ -3,8 +3,8 @@ var a = import("./side_effect2.js").then(function (m) { - return m.a; - }); + return m.a; +}); var M = await import("./side_effect.js"); diff --git a/jscomp/test/import_side_effect_free.js b/jscomp/test/import_side_effect_free.js index ba50c9d21f..c99fa4ba9a 100644 --- a/jscomp/test/import_side_effect_free.js +++ b/jscomp/test/import_side_effect_free.js @@ -3,8 +3,8 @@ var a = await import("./side_effect_free.js").then(function (m) { - return m.a; - }); + return m.a; +}); exports.a = a; /* a Not a pure module */ diff --git a/jscomp/test/inline_const.js b/jscomp/test/inline_const.js index 46d7e7c213..e4fa75bc1b 100644 --- a/jscomp/test/inline_const.js +++ b/jscomp/test/inline_const.js @@ -7,9 +7,9 @@ var N = {}; var hh = "hellohello"; console.log([ - 3e-6, - 3e-6 - ]); + 3e-6, + 3e-6 +]); var x = true; diff --git a/jscomp/test/inline_const_test.js b/jscomp/test/inline_const_test.js index 46d0bed3ef..71cf1e79ff 100644 --- a/jscomp/test/inline_const_test.js +++ b/jscomp/test/inline_const_test.js @@ -47,9 +47,9 @@ eq("File \"inline_const_test.res\", line 19, characters 5-12", 1, 1); eq("File \"inline_const_test.res\", line 20, characters 5-12", 3e-6, 0.000003); var h = Caml_int64.add(Caml_int64.add([ - 0, - 100 - ], Int64.one), Caml_int64.one); + 0, + 100 +], Int64.one), Caml_int64.one); Mt.from_pair_suites("File \"inline_const_test.res\", line 28, characters 29-36", suites.contents); diff --git a/jscomp/test/inline_map2_test.js b/jscomp/test/inline_map2_test.js index 5de9b8e1c0..59aa5650a5 100644 --- a/jscomp/test/inline_map2_test.js +++ b/jscomp/test/inline_map2_test.js @@ -1289,32 +1289,32 @@ var IntMap = { }; var m = List.fold_left((function (acc, param) { - return add(param[0], param[1], acc); - }), "Empty", { + return add(param[0], param[1], acc); +}), "Empty", { + hd: [ + 10, + /* 'a' */97 + ], + tl: { + hd: [ + 3, + /* 'b' */98 + ], + tl: { hd: [ - 10, - /* 'a' */97 + 7, + /* 'c' */99 ], tl: { hd: [ - 3, - /* 'b' */98 + 20, + /* 'd' */100 ], - tl: { - hd: [ - 7, - /* 'c' */99 - ], - tl: { - hd: [ - 20, - /* 'd' */100 - ], - tl: /* [] */0 - } - } + tl: /* [] */0 } - }); + } + } +}); function height$1(x) { if (typeof x !== "object") { @@ -1973,58 +1973,58 @@ var SMap = { }; var s = List.fold_left((function (acc, param) { - return add$1(param[0], param[1], acc); - }), "Empty", { + return add$1(param[0], param[1], acc); +}), "Empty", { + hd: [ + "10", + /* 'a' */97 + ], + tl: { + hd: [ + "3", + /* 'b' */98 + ], + tl: { hd: [ - "10", - /* 'a' */97 + "7", + /* 'c' */99 ], tl: { hd: [ - "3", - /* 'b' */98 + "20", + /* 'd' */100 ], - tl: { - hd: [ - "7", - /* 'c' */99 - ], - tl: { - hd: [ - "20", - /* 'd' */100 - ], - tl: /* [] */0 - } - } + tl: /* [] */0 } - }); + } + } +}); Mt.from_pair_suites("Inline_map2_test", { - hd: [ - "assertion1", - (function (param) { - return { - TAG: "Eq", - _0: find(10, m), - _1: /* 'a' */97 - }; - }) - ], - tl: { - hd: [ - "assertion2", - (function (param) { - return { - TAG: "Eq", - _0: find$1("10", s), - _1: /* 'a' */97 - }; - }) - ], - tl: /* [] */0 - } - }); + hd: [ + "assertion1", + (function (param) { + return { + TAG: "Eq", + _0: find(10, m), + _1: /* 'a' */97 + }; + }) + ], + tl: { + hd: [ + "assertion2", + (function (param) { + return { + TAG: "Eq", + _0: find$1("10", s), + _1: /* 'a' */97 + }; + }) + ], + tl: /* [] */0 + } +}); var empty = "Empty"; diff --git a/jscomp/test/inline_map_demo.js b/jscomp/test/inline_map_demo.js index f200cd312b..2867708415 100644 --- a/jscomp/test/inline_map_demo.js +++ b/jscomp/test/inline_map_demo.js @@ -138,32 +138,32 @@ function add(x, data, tree) { } var m = List.fold_left((function (acc, param) { - return add(param[0], param[1], acc); - }), "Empty", { + return add(param[0], param[1], acc); +}), "Empty", { + hd: [ + 10, + /* 'a' */97 + ], + tl: { + hd: [ + 3, + /* 'b' */98 + ], + tl: { hd: [ - 10, - /* 'a' */97 + 7, + /* 'c' */99 ], tl: { hd: [ - 3, - /* 'b' */98 + 20, + /* 'd' */100 ], - tl: { - hd: [ - 7, - /* 'c' */99 - ], - tl: { - hd: [ - 20, - /* 'd' */100 - ], - tl: /* [] */0 - } - } + tl: /* [] */0 } - }); + } + } +}); function find(px, _x) { while(true) { @@ -184,17 +184,17 @@ function find(px, _x) { } Mt.from_pair_suites("Inline_map_demo", { - hd: [ - "find", - (function (param) { - return { - TAG: "Eq", - _0: find(10, m), - _1: /* 'a' */97 - }; - }) - ], - tl: /* [] */0 - }); + hd: [ + "find", + (function (param) { + return { + TAG: "Eq", + _0: find(10, m), + _1: /* 'a' */97 + }; + }) + ], + tl: /* [] */0 +}); /* m Not a pure module */ diff --git a/jscomp/test/inline_map_test.js b/jscomp/test/inline_map_test.js index 7b204b82c3..159f3e0450 100644 --- a/jscomp/test/inline_map_test.js +++ b/jscomp/test/inline_map_test.js @@ -140,45 +140,45 @@ function find(x, _x_) { } var m = List.fold_left((function (acc, param) { - return add(param[0], param[1], acc); - }), "Empty", { + return add(param[0], param[1], acc); +}), "Empty", { + hd: [ + 10, + /* 'a' */97 + ], + tl: { + hd: [ + 3, + /* 'b' */98 + ], + tl: { hd: [ - 10, - /* 'a' */97 + 7, + /* 'c' */99 ], tl: { hd: [ - 3, - /* 'b' */98 + 20, + /* 'd' */100 ], - tl: { - hd: [ - 7, - /* 'c' */99 - ], - tl: { - hd: [ - 20, - /* 'd' */100 - ], - tl: /* [] */0 - } - } + tl: /* [] */0 } - }); + } + } +}); Mt.from_pair_suites("Inline_map_test", { - hd: [ - "find", - (function (param) { - return { - TAG: "Eq", - _0: find(10, m), - _1: /* 'a' */97 - }; - }) - ], - tl: /* [] */0 - }); + hd: [ + "find", + (function (param) { + return { + TAG: "Eq", + _0: find(10, m), + _1: /* 'a' */97 + }; + }) + ], + tl: /* [] */0 +}); /* m Not a pure module */ diff --git a/jscomp/test/inline_record_test.js b/jscomp/test/inline_record_test.js index ddf7f36777..4c31eb856d 100644 --- a/jscomp/test/inline_record_test.js +++ b/jscomp/test/inline_record_test.js @@ -37,12 +37,12 @@ var v1 = { function f(x) { if (x.TAG === "A0") { return List.fold_left((function (prim0, prim1) { - return prim0 + prim1 | 0; - }), x.lbl, x.more); + return prim0 + prim1 | 0; + }), x.lbl, x.more); } else { return List.fold_left((function (prim0, prim1) { - return prim0 + prim1 | 0; - }), 0, x.more); + return prim0 + prim1 | 0; + }), 0, x.more); } } diff --git a/jscomp/test/inline_regression_test.js b/jscomp/test/inline_regression_test.js index 27d9359da8..0e4621fab2 100644 --- a/jscomp/test/inline_regression_test.js +++ b/jscomp/test/inline_regression_test.js @@ -40,19 +40,19 @@ function generic_basename(is_dir_sep, current_dir_name, name) { function basename(param) { return generic_basename((function (s, i) { - return Caml_string.get(s, i) === /* '/' */47; - }), Filename.current_dir_name, param); + return Caml_string.get(s, i) === /* '/' */47; + }), Filename.current_dir_name, param); } var suites_0 = [ "basename", (function (param) { - return { - TAG: "Eq", - _0: basename("b/c/a.b"), - _1: "a.b" - }; - }) + return { + TAG: "Eq", + _0: basename("b/c/a.b"), + _1: "a.b" + }; + }) ]; var suites = { diff --git a/jscomp/test/inline_string_test.js b/jscomp/test/inline_string_test.js index fa4faecbf0..c81d1e60ac 100644 --- a/jscomp/test/inline_string_test.js +++ b/jscomp/test/inline_string_test.js @@ -15,14 +15,14 @@ function f(x) { } console.log([ - f(3), - "None", - "Some" - ]); + f(3), + "None", + "Some" +]); console.log([ - "A", - "A" - ]); + "A", + "A" +]); /* Not a pure module */ diff --git a/jscomp/test/installation_test.js b/jscomp/test/installation_test.js index 758cd600de..234a716c02 100644 --- a/jscomp/test/installation_test.js +++ b/jscomp/test/installation_test.js @@ -17,12 +17,12 @@ function eq(loc, x, y) { hd: [ loc + (" id " + String(test_id.contents)), (function (param) { - return { - TAG: "Eq", - _0: x, - _1: y - }; - }) + return { + TAG: "Eq", + _0: x, + _1: y + }; + }) ], tl: suites.contents }; diff --git a/jscomp/test/int32_test.js b/jscomp/test/int32_test.js index c59783fb9c..ae6277dbf7 100644 --- a/jscomp/test/int32_test.js +++ b/jscomp/test/int32_test.js @@ -17,8 +17,8 @@ function f(x) { } var shift_right_logical_tests_0 = $$Array.map((function (x) { - return (-1 >>> x) | 0; - }), Ext_array_test.range(0, 31)); + return (-1 >>> x) | 0; +}), Ext_array_test.range(0, 31)); var shift_right_logical_tests_1 = [ -1, @@ -61,8 +61,8 @@ var shift_right_logical_tests = [ ]; var shift_right_tests_0 = $$Array.map((function (x) { - return (Int32.min_int >> x); - }), Ext_array_test.range(0, 31)); + return (Int32.min_int >> x); +}), Ext_array_test.range(0, 31)); var shift_right_tests_1 = [ -2147483648, @@ -105,8 +105,8 @@ var shift_right_tests = [ ]; var shift_left_tests_0 = $$Array.map((function (x) { - return (1 << x); - }), Ext_array_test.range(0, 31)); + return (1 << x); +}), Ext_array_test.range(0, 31)); var shift_left_tests_1 = [ 1, @@ -154,63 +154,63 @@ function $star$tilde(prim0, prim1) { var suites = { contents: Pervasives.$at({ - hd: [ - "File \"int32_test.res\", line 131, characters 9-16", - (function (param) { - return { - TAG: "Eq", - _0: 1, - _1: 1 - }; - }) - ], - tl: { - hd: [ - "File \"int32_test.res\", line 132, characters 9-16", - (function (param) { - return { - TAG: "Eq", - _0: -2147483647, - _1: -2147483647 - }; - }) - ], - tl: /* [] */0 - } - }, Pervasives.$at($$Array.to_list(Ext_array_test.map2i((function (i, a, b) { - return [ - "shift_right_logical_cases " + i, - (function (param) { - return { - TAG: "Eq", - _0: a, - _1: b - }; - }) - ]; - }), shift_right_logical_tests_0, shift_right_logical_tests_1)), Pervasives.$at($$Array.to_list(Ext_array_test.map2i((function (i, a, b) { - return [ - "shift_right_cases " + i, - (function (param) { - return { - TAG: "Eq", - _0: a, - _1: b - }; - }) - ]; - }), shift_right_tests_0, shift_right_tests_1)), $$Array.to_list(Ext_array_test.map2i((function (i, a, b) { - return [ - "shift_left_cases " + i, - (function (param) { - return { - TAG: "Eq", - _0: a, - _1: b - }; - }) - ]; - }), shift_left_tests_0, shift_left_tests_1))))) + hd: [ + "File \"int32_test.res\", line 131, characters 9-16", + (function (param) { + return { + TAG: "Eq", + _0: 1, + _1: 1 + }; + }) + ], + tl: { + hd: [ + "File \"int32_test.res\", line 132, characters 9-16", + (function (param) { + return { + TAG: "Eq", + _0: -2147483647, + _1: -2147483647 + }; + }) + ], + tl: /* [] */0 + } + }, Pervasives.$at($$Array.to_list(Ext_array_test.map2i((function (i, a, b) { + return [ + "shift_right_logical_cases " + i, + (function (param) { + return { + TAG: "Eq", + _0: a, + _1: b + }; + }) + ]; + }), shift_right_logical_tests_0, shift_right_logical_tests_1)), Pervasives.$at($$Array.to_list(Ext_array_test.map2i((function (i, a, b) { + return [ + "shift_right_cases " + i, + (function (param) { + return { + TAG: "Eq", + _0: a, + _1: b + }; + }) + ]; + }), shift_right_tests_0, shift_right_tests_1)), $$Array.to_list(Ext_array_test.map2i((function (i, a, b) { + return [ + "shift_left_cases " + i, + (function (param) { + return { + TAG: "Eq", + _0: a, + _1: b + }; + }) + ]; + }), shift_left_tests_0, shift_left_tests_1))))) }; var test_id = { diff --git a/jscomp/test/int64_mul_div_test.js b/jscomp/test/int64_mul_div_test.js index 749720b846..cc0828cd66 100644 --- a/jscomp/test/int64_mul_div_test.js +++ b/jscomp/test/int64_mul_div_test.js @@ -307,16 +307,16 @@ var pairs = [ function from_pairs(prefix, pairs) { return $$Array.to_list($$Array.mapi((function (i, param) { - var b = param[2]; - var a = param[1]; - var result = param[0]; - return [ - prefix + "_" + i, - (function (param) { - return commutative_mul(result, a, b); - }) - ]; - }), pairs)); + var b = param[2]; + var a = param[1]; + var result = param[0]; + return [ + prefix + "_" + i, + (function (param) { + return commutative_mul(result, a, b); + }) + ]; + }), pairs)); } var small_pairs = [ @@ -1510,27 +1510,27 @@ var simple_divs = [ function from(xs) { return List.mapi((function (i, param) { - var d = param[3]; - var c = param[2]; - var b = param[1]; - var a = param[0]; - return [ - "small_divs " + i, - (function (param) { - return { - TAG: "Eq", - _0: [ - c, - d - ], - _1: [ - Caml_int64.div(a, b), - Caml_int64.mod_(a, b) - ] - }; - }) - ]; - }), $$Array.to_list(xs)); + var d = param[3]; + var c = param[2]; + var b = param[1]; + var a = param[0]; + return [ + "small_divs " + i, + (function (param) { + return { + TAG: "Eq", + _0: [ + c, + d + ], + _1: [ + Caml_int64.div(a, b), + Caml_int64.mod_(a, b) + ] + }; + }) + ]; + }), $$Array.to_list(xs)); } var to_string = [[ @@ -1567,116 +1567,116 @@ var int64_compare_tests = [ function from_compare(xs) { return List.mapi((function (i, param) { - var c = param[2]; - var b = param[1]; - var a = param[0]; - return [ - "int64_compare " + i, - (function (param) { - return { - TAG: "Eq", - _0: c, - _1: Caml_int64.compare(a, b) - }; - }) - ]; - }), $$Array.to_list(xs)); + var c = param[2]; + var b = param[1]; + var a = param[0]; + return [ + "int64_compare " + i, + (function (param) { + return { + TAG: "Eq", + _0: c, + _1: Caml_int64.compare(a, b) + }; + }) + ]; + }), $$Array.to_list(xs)); } function from_to_string(xs) { return List.mapi((function (i, param) { - var str_a = param[1]; - var a = param[0]; - return [ - "to_string " + i, - (function (param) { - return { - TAG: "Eq", - _0: str_a, - _1: Caml_int64.to_string(a) - }; - }) - ]; - }), $$Array.to_list(xs)); + var str_a = param[1]; + var a = param[0]; + return [ + "to_string " + i, + (function (param) { + return { + TAG: "Eq", + _0: str_a, + _1: Caml_int64.to_string(a) + }; + }) + ]; + }), $$Array.to_list(xs)); } Mt.from_pair_suites("Int64_mul_div_test", Pervasives.$at(from_pairs("random", pairs), Pervasives.$at(from_pairs("small", small_pairs), Pervasives.$at(List.mapi((function (i, param) { - var f = param[1]; - var i64 = param[0]; - return [ - "to_float_" + i, - (function (param) { - return { - TAG: "Eq", - _0: Caml_int64.to_float(i64), - _1: f - }; - }) - ]; - }), $$Array.to_list(to_floats)), Pervasives.$at(List.mapi((function (i, param) { - var i64 = param[1]; - var f = param[0]; - return [ - "of_float_" + i, - (function (param) { - return { - TAG: "Eq", - _0: Caml_int64.of_float(f), - _1: i64 - }; - }) - ]; - }), $$Array.to_list(of_float_pairs)), Pervasives.$at({ - hd: [ - "compare_check_complete", - (function (param) { - return { - TAG: "Eq", - _0: $$Array.map((function (param) { - return true; - }), check_complete_compare), - _1: check_complete_compare - }; - }) - ], - tl: /* [] */0 - }, Pervasives.$at(from(simple_divs), Pervasives.$at(from_compare(int64_compare_tests), { - hd: [ - "div_rem_0", - (function (param) { - return { - TAG: "Eq", - _0: Caml_int64.zero, - _1: Caml_int64.zero - }; - }) - ], - tl: { - hd: [ - "div_rem_1", - (function (param) { - return { - TAG: "Eq", - _0: Caml_int64.neg_one, - _1: Caml_int64.neg_one - }; - }) - ], - tl: { - hd: [ - "File \"int64_mul_div_test.res\", line 263, characters 19-26", - (function (param) { - return { - TAG: "Eq", - _0: Caml_int64.to_float(Int64.max_int), - _1: 9.22337203685477581e+18 - }; - }) - ], - tl: /* [] */0 - } - } - })))))))); + var f = param[1]; + var i64 = param[0]; + return [ + "to_float_" + i, + (function (param) { + return { + TAG: "Eq", + _0: Caml_int64.to_float(i64), + _1: f + }; + }) + ]; +}), $$Array.to_list(to_floats)), Pervasives.$at(List.mapi((function (i, param) { + var i64 = param[1]; + var f = param[0]; + return [ + "of_float_" + i, + (function (param) { + return { + TAG: "Eq", + _0: Caml_int64.of_float(f), + _1: i64 + }; + }) + ]; +}), $$Array.to_list(of_float_pairs)), Pervasives.$at({ + hd: [ + "compare_check_complete", + (function (param) { + return { + TAG: "Eq", + _0: $$Array.map((function (param) { + return true; + }), check_complete_compare), + _1: check_complete_compare + }; + }) + ], + tl: /* [] */0 +}, Pervasives.$at(from(simple_divs), Pervasives.$at(from_compare(int64_compare_tests), { + hd: [ + "div_rem_0", + (function (param) { + return { + TAG: "Eq", + _0: Caml_int64.zero, + _1: Caml_int64.zero + }; + }) + ], + tl: { + hd: [ + "div_rem_1", + (function (param) { + return { + TAG: "Eq", + _0: Caml_int64.neg_one, + _1: Caml_int64.neg_one + }; + }) + ], + tl: { + hd: [ + "File \"int64_mul_div_test.res\", line 263, characters 19-26", + (function (param) { + return { + TAG: "Eq", + _0: Caml_int64.to_float(Int64.max_int), + _1: 9.22337203685477581e+18 + }; + }) + ], + tl: /* [] */0 + } + } +})))))))); exports.commutative_mul = commutative_mul; exports.pairs = pairs; diff --git a/jscomp/test/int64_string_bench.js b/jscomp/test/int64_string_bench.js index 614bdc7f4e..eedad7bf4f 100644 --- a/jscomp/test/int64_string_bench.js +++ b/jscomp/test/int64_string_bench.js @@ -7,9 +7,9 @@ var Caml_int64 = require("../../lib/js/caml_int64.js"); console.time("Int64.to_string"); var u = Caml_int64.sub(Int64.max_int, [ - 0, - 200000 - ]); + 0, + 200000 +]); for(var i = 0; i <= 100000; ++i){ Caml_int64.to_string(u); @@ -37,9 +37,9 @@ console.log(Caml_int64.to_string(u$1)); console.time("Int64.to_string"); var u$2 = Caml_int64.add(Int64.min_int, [ - 0, - 100 - ]); + 0, + 100 +]); for(var i$2 = 0; i$2 <= 100000; ++i$2){ Caml_int64.to_string(u$2); diff --git a/jscomp/test/int64_string_test.js b/jscomp/test/int64_string_test.js index 24ef99e7a8..d4539d3143 100644 --- a/jscomp/test/int64_string_test.js +++ b/jscomp/test/int64_string_test.js @@ -27,33 +27,33 @@ function f(a, b) { } var hh = Caml_int64.add(Int64.min_int, [ - 0, - 100 - ]); + 0, + 100 +]); eq("File \"int64_string_test.res\", line 14, characters 3-10", hh, [ - -2147483648, - 100 - ]); + -2147483648, + 100 +]); f([ - -1, - 4294967263 - ], "-33"); + -1, + 4294967263 +], "-33"); f([ - 0, - 33 - ], "33"); + 0, + 33 +], "33"); f(Int64.min_int, "-9223372036854775808"); f(hh, "-9223372036854775708"); f([ - 232830, - 2764472320 - ], "1000000000000000"); + 232830, + 2764472320 +], "1000000000000000"); for(var i = 0; i <= 8; ++i){ eq("File \"int64_string_test.res\", line 22, characters 4-11", Caml_int64.to_string(Caml_int64.add(Int64.min_int, Caml_int64.of_int32(i))), "-922337203685477580" + String(8 - i | 0)); @@ -86,19 +86,19 @@ for(var i$4 = 0; i$4 <= 9; ++i$4){ } eq("File \"int64_string_test.res\", line 73, characters 3-10", Caml_int64.to_string([ - 2097151, - 4294967295 - ]), "9007199254740991"); + 2097151, + 4294967295 +]), "9007199254740991"); eq("File \"int64_string_test.res\", line 74, characters 3-10", Caml_int64.to_string([ - -2097152, - 1 - ]), "-9007199254740991"); + -2097152, + 1 +]), "-9007199254740991"); eq("File \"int64_string_test.res\", line 75, characters 3-10", Caml_int64.to_string([ - -1, - 4294967063 - ]), "-233"); + -1, + 4294967063 +]), "-233"); eq("File \"int64_string_test.res\", line 77, characters 2-9", Caml_int64.to_string(Caml_int64.max_int), "9223372036854775807"); @@ -1305,41 +1305,41 @@ var random_data = { }; Belt_List.forEach(random_data, (function (u) { - if (u) { - if (u.tl) { - throw { - RE_EXN_ID: "Assert_failure", - _1: [ - "int64_string_test.res", - 191, - 9 - ], - Error: new Error() - }; - } - var match = u.hd; - return eq("File \"int64_string_test.res\", line 190, characters 25-32", Caml_int64.to_string(match[0]), match[1]); - } - throw { - RE_EXN_ID: "Assert_failure", - _1: [ - "int64_string_test.res", - 191, - 9 - ], - Error: new Error() - }; - })); + if (u) { + if (u.tl) { + throw { + RE_EXN_ID: "Assert_failure", + _1: [ + "int64_string_test.res", + 191, + 9 + ], + Error: new Error() + }; + } + var match = u.hd; + return eq("File \"int64_string_test.res\", line 190, characters 25-32", Caml_int64.to_string(match[0]), match[1]); + } + throw { + RE_EXN_ID: "Assert_failure", + _1: [ + "int64_string_test.res", + 191, + 9 + ], + Error: new Error() + }; +})); eq("File \"int64_string_test.res\", line 195, characters 3-10", Caml_int64.to_string([ - -2097152, - 1 - ]), "-9007199254740991"); + -2097152, + 1 +]), "-9007199254740991"); eq("File \"int64_string_test.res\", line 196, characters 3-10", Caml_int64.to_string([ - -2097152, - 0 - ]), "-9007199254740992"); + -2097152, + 0 +]), "-9007199254740992"); Mt.from_pair_suites("File \"int64_string_test.res\", line 197, characters 20-27", suites.contents); diff --git a/jscomp/test/int64_test.js b/jscomp/test/int64_test.js index 2681b07784..1c3ced7939 100644 --- a/jscomp/test/int64_test.js +++ b/jscomp/test/int64_test.js @@ -36,8 +36,8 @@ function commutative_add(result, a, b) { var generic_compare = Caml_obj.compare; var shift_left_tests_0 = $$Array.map((function (i) { - return Caml_int64.lsl_(Caml_int64.one, i); - }), Ext_array_test.range(0, 63)); + return Caml_int64.lsl_(Caml_int64.one, i); +}), Ext_array_test.range(0, 63)); var shift_left_tests_1 = [ Caml_int64.one, @@ -298,8 +298,8 @@ var shift_left_tests = [ ]; var shift_right_tests_0 = $$Array.map((function (i) { - return Caml_int64.asr_(Caml_int64.min_int, i); - }), Ext_array_test.range(0, 63)); + return Caml_int64.asr_(Caml_int64.min_int, i); +}), Ext_array_test.range(0, 63)); var shift_right_tests_1 = [ Caml_int64.min_int, @@ -560,8 +560,8 @@ var shift_right_tests = [ ]; var shift_right_logical_suites_0 = $$Array.map((function (i) { - return Caml_int64.lsr_(Caml_int64.min_int, i); - }), Ext_array_test.range(0, 63)); + return Caml_int64.lsr_(Caml_int64.min_int, i); +}), Ext_array_test.range(0, 63)); var shift_right_logical_suites_1 = [ Caml_int64.min_int, @@ -850,1215 +850,1213 @@ function fac(_n, _acc) { } var suites = Pervasives.$at({ + hd: [ + "add_one", + (function (param) { + return { + TAG: "Eq", + _0: v, + _1: [ + 0, + 2147483648 + ] + }; + }) + ], + tl: { + hd: [ + "add_2", + (function (param) { + return { + TAG: "Eq", + _0: [ + 0, + 4294967294 + ], + _1: Caml_int64.add(a, a) + }; + }) + ], + tl: { hd: [ - "add_one", + "add_3", (function (param) { - return { - TAG: "Eq", - _0: v, - _1: [ - 0, - 2147483648 - ] - }; - }) + return { + TAG: "Eq", + _0: Caml_int64.zero, + _1: Caml_int64.zero + }; + }) ], tl: { hd: [ - "add_2", + "add_4", (function (param) { - return { - TAG: "Eq", - _0: [ - 0, - 4294967294 - ], - _1: Caml_int64.add(a, a) - }; - }) + return commutative_add([ + -1, + 4294967294 + ], [ + -1, + 4294967293 + ], Caml_int64.one); + }) ], tl: { hd: [ - "add_3", + "add_5", (function (param) { - return { - TAG: "Eq", - _0: Caml_int64.zero, - _1: Caml_int64.zero - }; - }) + return commutative_add([ + -1, + 4294967293 + ], [ + -1, + 4294967293 + ], Caml_int64.zero); + }) ], tl: { hd: [ - "add_4", + "add_6", (function (param) { - return commutative_add([ - -1, - 4294967294 - ], [ - -1, - 4294967293 - ], Caml_int64.one); - }) + return commutative_add([ + 0, + 4 + ], [ + -1, + 4294967293 + ], [ + 0, + 7 + ]); + }) ], tl: { hd: [ - "add_5", + "add_7", (function (param) { - return commutative_add([ - -1, - 4294967293 - ], [ - -1, - 4294967293 - ], Caml_int64.zero); - }) + return commutative_add([ + 1, + 0 + ], [ + 0, + 2147483648 + ], [ + 0, + 2147483648 + ]); + }) ], tl: { hd: [ - "add_6", + "add_8", (function (param) { - return commutative_add([ - 0, - 4 - ], [ - -1, - 4294967293 - ], [ - 0, - 7 - ]); - }) + return commutative_add([ + 1, + 0 + ], [ + 0, + 4294967295 + ], Caml_int64.one); + }) ], tl: { hd: [ - "add_7", + "add_9", (function (param) { - return commutative_add([ - 1, - 0 - ], [ - 0, - 2147483648 - ], [ - 0, - 2147483648 - ]); - }) + return commutative_add([ + 0, + 4294967295 + ], [ + 0, + 2147483648 + ], [ + 0, + 2147483647 + ]); + }) ], tl: { hd: [ - "add_8", + "add_10", (function (param) { - return commutative_add([ - 1, - 0 - ], [ - 0, - 4294967295 - ], Caml_int64.one); - }) + return commutative_add([ + 0, + 2147483648 + ], [ + 0, + 2147483648 + ], Caml_int64.zero); + }) ], tl: { hd: [ - "add_9", + "add_11", (function (param) { - return commutative_add([ - 0, - 4294967295 - ], [ - 0, - 2147483648 - ], [ - 0, - 2147483647 - ]); - }) + return commutative_add([ + 0, + 4294967295 + ], [ + 0, + 4294967295 + ], Caml_int64.zero); + }) ], tl: { hd: [ - "add_10", + "to_int32", (function (param) { - return commutative_add([ - 0, - 2147483648 - ], [ - 0, - 2147483648 - ], Caml_int64.zero); - }) + return { + TAG: "Eq", + _0: 3, + _1: Caml_int64.to_int32([ + 0, + 3 + ]) + }; + }) ], tl: { hd: [ - "add_11", + "to_int", (function (param) { - return commutative_add([ - 0, - 4294967295 - ], [ - 0, - 4294967295 - ], Caml_int64.zero); - }) + return { + TAG: "Eq", + _0: 3, + _1: Caml_int64.to_int32([ + 0, + 3 + ]) + }; + }) ], tl: { hd: [ - "to_int32", + "of_int", (function (param) { - return { - TAG: "Eq", - _0: 3, - _1: Caml_int64.to_int32([ - 0, - 3 - ]) - }; - }) + return { + TAG: "Eq", + _0: [ + 0, + 3 + ], + _1: [ + 0, + 3 + ] + }; + }) ], tl: { hd: [ - "to_int", + "lognot", (function (param) { - return { - TAG: "Eq", - _0: 3, - _1: Caml_int64.to_int32([ - 0, - 3 - ]) - }; - }) + return { + TAG: "Eq", + _0: [ + -1, + 4294967293 + ], + _1: [ + -1, + 4294967293 + ] + }; + }) ], tl: { hd: [ - "of_int", + "neg", (function (param) { - return { - TAG: "Eq", - _0: [ - 0, - 3 - ], - _1: [ - 0, - 3 - ] - }; - }) + return { + TAG: "Eq", + _0: [ + -1, + 4294967294 + ], + _1: [ + -1, + 4294967294 + ] + }; + }) ], tl: { hd: [ - "lognot", + "File \"int64_test.res\", line 277, characters 7-14", (function (param) { - return { - TAG: "Eq", - _0: [ - -1, - 4294967293 - ], - _1: [ - -1, - 4294967293 - ] - }; - }) + return { + TAG: "Eq", + _0: Int64.min_int, + _1: Caml_int64.neg(Int64.min_int) + }; + }) ], tl: { hd: [ - "neg", + "File \"int64_test.res\", line 279, characters 8-15", (function (param) { + return { + TAG: "Eq", + _0: Int64.max_int, + _1: Caml_int64.neg(Caml_int64.add(Int64.min_int, Caml_int64.one)) + }; + }) + ], + tl: { + hd: [ + "sub1", + (function (param) { return { TAG: "Eq", _0: [ - -1, - 4294967294 + 0, + 2 ], _1: [ - -1, - 4294967294 + 0, + 2 ] }; }) - ], - tl: { - hd: [ - "File \"int64_test.res\", line 277, characters 7-14", - (function (param) { - return { - TAG: "Eq", - _0: Int64.min_int, - _1: Caml_int64.neg(Int64.min_int) - }; - }) ], tl: { hd: [ - "File \"int64_test.res\", line 279, characters 8-15", + "xor1", (function (param) { - return { - TAG: "Eq", - _0: Int64.max_int, - _1: Caml_int64.neg(Caml_int64.add(Int64.min_int, Caml_int64.one)) - }; - }) + return { + TAG: "Eq", + _0: [ + [ + 0, + 286331153 + ], + Caml_int64.xor(a, [ + 0, + 4009750271 + ]) + ], + _1: [ + [ + 0, + 286331153 + ], + [ + 0, + 2432700672 + ] + ] + }; + }) ], tl: { hd: [ - "sub1", + "or", (function (param) { + return { + TAG: "Eq", + _0: [ + 0, + 4294967295 + ], + _1: [ + 0, + 4294967295 + ] + }; + }) + ], + tl: { + hd: [ + "and", + (function (param) { return { TAG: "Eq", _0: [ 0, - 2 + 4008636142 ], _1: [ 0, - 2 + 4008636142 ] }; }) - ], - tl: { - hd: [ - "xor1", - (function (param) { + ], + tl: { + hd: [ + "lsl", + (function (param) { return { TAG: "Eq", - _0: [ + _0: $$Array.map((function (x) { + return Caml_int64.lsl_(Caml_int64.one, x); + }), $$Array.init(64, (function (i) { + return i; + }))), + _1: [ + Caml_int64.one, [ 0, - 286331153 + 2 ], - Caml_int64.xor(a, [ - 0, - 4009750271 - ]) - ], - _1: [ [ 0, - 286331153 + 4 ], [ 0, - 2432700672 - ] - ] - }; - }) - ], - tl: { - hd: [ - "or", - (function (param) { - return { - TAG: "Eq", - _0: [ + 8 + ], + [ 0, - 4294967295 + 16 ], - _1: [ + [ 0, - 4294967295 - ] - }; - }) - ], - tl: { - hd: [ - "and", - (function (param) { - return { - TAG: "Eq", - _0: [ - 0, - 4008636142 - ], - _1: [ - 0, - 4008636142 - ] - }; - }) - ], - tl: { - hd: [ - "lsl", - (function (param) { - return { - TAG: "Eq", - _0: $$Array.map((function (x) { - return Caml_int64.lsl_(Caml_int64.one, x); - }), $$Array.init(64, (function (i) { - return i; - }))), - _1: [ - Caml_int64.one, - [ - 0, - 2 - ], - [ - 0, - 4 - ], - [ - 0, - 8 - ], - [ - 0, - 16 - ], - [ - 0, - 32 - ], - [ - 0, - 64 - ], - [ - 0, - 128 - ], - [ - 0, - 256 - ], - [ - 0, - 512 - ], - [ - 0, - 1024 - ], - [ - 0, - 2048 - ], - [ - 0, - 4096 - ], - [ - 0, - 8192 - ], - [ - 0, - 16384 - ], - [ - 0, - 32768 - ], - [ - 0, - 65536 - ], - [ - 0, - 131072 - ], - [ - 0, - 262144 - ], - [ - 0, - 524288 - ], - [ - 0, - 1048576 - ], - [ - 0, - 2097152 - ], - [ - 0, - 4194304 - ], - [ - 0, - 8388608 - ], - [ - 0, - 16777216 - ], - [ - 0, - 33554432 - ], - [ - 0, - 67108864 - ], - [ - 0, - 134217728 - ], - [ - 0, - 268435456 - ], - [ - 0, - 536870912 - ], - [ - 0, - 1073741824 - ], - [ - 0, - 2147483648 - ], - [ - 1, - 0 - ], - [ - 2, - 0 - ], - [ - 4, - 0 - ], - [ - 8, - 0 - ], - [ - 16, - 0 - ], - [ - 32, - 0 - ], - [ - 64, - 0 - ], - [ - 128, - 0 - ], - [ - 256, - 0 - ], - [ - 512, - 0 - ], - [ - 1024, - 0 - ], - [ - 2048, - 0 - ], - [ - 4096, - 0 - ], - [ - 8192, - 0 - ], - [ - 16384, - 0 - ], - [ - 32768, - 0 - ], - [ - 65536, - 0 - ], - [ - 131072, - 0 - ], - [ - 262144, - 0 - ], - [ - 524288, - 0 - ], - [ - 1048576, - 0 - ], - [ - 2097152, - 0 - ], - [ - 4194304, - 0 - ], - [ - 8388608, - 0 - ], - [ - 16777216, - 0 - ], - [ - 33554432, - 0 - ], - [ - 67108864, - 0 - ], - [ - 134217728, - 0 - ], - [ - 268435456, - 0 - ], - [ - 536870912, - 0 - ], - [ - 1073741824, - 0 - ], - Caml_int64.min_int - ] - }; - }) - ], - tl: { - hd: [ - "lsr", - (function (param) { - return { - TAG: "Eq", - _0: $$Array.map((function (x) { - return Caml_int64.lsr_(Caml_int64.neg_one, x); - }), $$Array.init(64, (function (i) { - return i; - }))), - _1: [ - Caml_int64.neg_one, - Caml_int64.max_int, - [ - 1073741823, - 4294967295 - ], - [ - 536870911, - 4294967295 - ], - [ - 268435455, - 4294967295 - ], - [ - 134217727, - 4294967295 - ], - [ - 67108863, - 4294967295 - ], - [ - 33554431, - 4294967295 - ], - [ - 16777215, - 4294967295 - ], - [ - 8388607, - 4294967295 - ], - [ - 4194303, - 4294967295 - ], - [ - 2097151, - 4294967295 - ], - [ - 1048575, - 4294967295 - ], - [ - 524287, - 4294967295 - ], - [ - 262143, - 4294967295 - ], - [ - 131071, - 4294967295 - ], - [ - 65535, - 4294967295 - ], - [ - 32767, - 4294967295 - ], - [ - 16383, - 4294967295 - ], - [ - 8191, - 4294967295 - ], - [ - 4095, - 4294967295 - ], - [ - 2047, - 4294967295 - ], - [ - 1023, - 4294967295 - ], - [ - 511, - 4294967295 - ], - [ - 255, - 4294967295 - ], - [ - 127, - 4294967295 - ], - [ - 63, - 4294967295 - ], - [ - 31, - 4294967295 - ], - [ - 15, - 4294967295 - ], - [ - 7, - 4294967295 - ], - [ - 3, - 4294967295 - ], - [ - 1, - 4294967295 - ], - [ - 0, - 4294967295 - ], - [ - 0, - 2147483647 - ], - [ - 0, - 1073741823 - ], - [ - 0, - 536870911 - ], - [ - 0, - 268435455 - ], - [ - 0, - 134217727 - ], - [ - 0, - 67108863 - ], - [ - 0, - 33554431 - ], - [ - 0, - 16777215 - ], - [ - 0, - 8388607 - ], - [ - 0, - 4194303 - ], - [ - 0, - 2097151 - ], - [ - 0, - 1048575 - ], - [ - 0, - 524287 - ], - [ - 0, - 262143 - ], - [ - 0, - 131071 - ], - [ - 0, - 65535 - ], - [ - 0, - 32767 - ], - [ - 0, - 16383 - ], - [ - 0, - 8191 - ], - [ - 0, - 4095 - ], - [ - 0, - 2047 - ], - [ - 0, - 1023 - ], - [ - 0, - 511 - ], - [ - 0, - 255 - ], - [ - 0, - 127 - ], - [ - 0, - 63 - ], - [ - 0, - 31 - ], - [ - 0, - 15 - ], - [ - 0, - 7 - ], - [ - 0, - 3 - ], - Caml_int64.one - ] - }; - }) + 32 + ], + [ + 0, + 64 + ], + [ + 0, + 128 + ], + [ + 0, + 256 + ], + [ + 0, + 512 + ], + [ + 0, + 1024 + ], + [ + 0, + 2048 + ], + [ + 0, + 4096 + ], + [ + 0, + 8192 + ], + [ + 0, + 16384 + ], + [ + 0, + 32768 + ], + [ + 0, + 65536 + ], + [ + 0, + 131072 + ], + [ + 0, + 262144 + ], + [ + 0, + 524288 + ], + [ + 0, + 1048576 + ], + [ + 0, + 2097152 + ], + [ + 0, + 4194304 + ], + [ + 0, + 8388608 + ], + [ + 0, + 16777216 + ], + [ + 0, + 33554432 + ], + [ + 0, + 67108864 + ], + [ + 0, + 134217728 + ], + [ + 0, + 268435456 + ], + [ + 0, + 536870912 + ], + [ + 0, + 1073741824 + ], + [ + 0, + 2147483648 + ], + [ + 1, + 0 + ], + [ + 2, + 0 + ], + [ + 4, + 0 + ], + [ + 8, + 0 + ], + [ + 16, + 0 + ], + [ + 32, + 0 + ], + [ + 64, + 0 + ], + [ + 128, + 0 + ], + [ + 256, + 0 + ], + [ + 512, + 0 + ], + [ + 1024, + 0 + ], + [ + 2048, + 0 + ], + [ + 4096, + 0 + ], + [ + 8192, + 0 + ], + [ + 16384, + 0 + ], + [ + 32768, + 0 + ], + [ + 65536, + 0 + ], + [ + 131072, + 0 + ], + [ + 262144, + 0 + ], + [ + 524288, + 0 + ], + [ + 1048576, + 0 + ], + [ + 2097152, + 0 + ], + [ + 4194304, + 0 + ], + [ + 8388608, + 0 + ], + [ + 16777216, + 0 + ], + [ + 33554432, + 0 + ], + [ + 67108864, + 0 + ], + [ + 134217728, + 0 + ], + [ + 268435456, + 0 + ], + [ + 536870912, + 0 + ], + [ + 1073741824, + 0 + ], + Caml_int64.min_int + ] + }; + }) + ], + tl: { + hd: [ + "lsr", + (function (param) { + return { + TAG: "Eq", + _0: $$Array.map((function (x) { + return Caml_int64.lsr_(Caml_int64.neg_one, x); + }), $$Array.init(64, (function (i) { + return i; + }))), + _1: [ + Caml_int64.neg_one, + Caml_int64.max_int, + [ + 1073741823, + 4294967295 + ], + [ + 536870911, + 4294967295 + ], + [ + 268435455, + 4294967295 + ], + [ + 134217727, + 4294967295 + ], + [ + 67108863, + 4294967295 + ], + [ + 33554431, + 4294967295 + ], + [ + 16777215, + 4294967295 + ], + [ + 8388607, + 4294967295 + ], + [ + 4194303, + 4294967295 + ], + [ + 2097151, + 4294967295 + ], + [ + 1048575, + 4294967295 + ], + [ + 524287, + 4294967295 + ], + [ + 262143, + 4294967295 + ], + [ + 131071, + 4294967295 + ], + [ + 65535, + 4294967295 + ], + [ + 32767, + 4294967295 + ], + [ + 16383, + 4294967295 + ], + [ + 8191, + 4294967295 + ], + [ + 4095, + 4294967295 + ], + [ + 2047, + 4294967295 + ], + [ + 1023, + 4294967295 + ], + [ + 511, + 4294967295 + ], + [ + 255, + 4294967295 + ], + [ + 127, + 4294967295 + ], + [ + 63, + 4294967295 + ], + [ + 31, + 4294967295 + ], + [ + 15, + 4294967295 + ], + [ + 7, + 4294967295 + ], + [ + 3, + 4294967295 + ], + [ + 1, + 4294967295 + ], + [ + 0, + 4294967295 + ], + [ + 0, + 2147483647 + ], + [ + 0, + 1073741823 + ], + [ + 0, + 536870911 + ], + [ + 0, + 268435455 + ], + [ + 0, + 134217727 + ], + [ + 0, + 67108863 + ], + [ + 0, + 33554431 + ], + [ + 0, + 16777215 + ], + [ + 0, + 8388607 + ], + [ + 0, + 4194303 + ], + [ + 0, + 2097151 + ], + [ + 0, + 1048575 + ], + [ + 0, + 524287 + ], + [ + 0, + 262143 + ], + [ + 0, + 131071 + ], + [ + 0, + 65535 + ], + [ + 0, + 32767 + ], + [ + 0, + 16383 + ], + [ + 0, + 8191 + ], + [ + 0, + 4095 + ], + [ + 0, + 2047 + ], + [ + 0, + 1023 + ], + [ + 0, + 511 + ], + [ + 0, + 255 + ], + [ + 0, + 127 + ], + [ + 0, + 63 + ], + [ + 0, + 31 + ], + [ + 0, + 15 + ], + [ + 0, + 7 + ], + [ + 0, + 3 + ], + Caml_int64.one + ] + }; + }) + ], + tl: { + hd: [ + "asr", + (function (param) { + return { + TAG: "Eq", + _0: $$Array.map((function (x) { + return Caml_int64.asr_(Caml_int64.neg_one, x); + }), $$Array.init(64, (function (i) { + return i; + }))), + _1: [ + Caml_int64.neg_one, + Caml_int64.neg_one, + Caml_int64.neg_one, + Caml_int64.neg_one, + Caml_int64.neg_one, + Caml_int64.neg_one, + Caml_int64.neg_one, + Caml_int64.neg_one, + Caml_int64.neg_one, + Caml_int64.neg_one, + Caml_int64.neg_one, + Caml_int64.neg_one, + Caml_int64.neg_one, + Caml_int64.neg_one, + Caml_int64.neg_one, + Caml_int64.neg_one, + Caml_int64.neg_one, + Caml_int64.neg_one, + Caml_int64.neg_one, + Caml_int64.neg_one, + Caml_int64.neg_one, + Caml_int64.neg_one, + Caml_int64.neg_one, + Caml_int64.neg_one, + Caml_int64.neg_one, + Caml_int64.neg_one, + Caml_int64.neg_one, + Caml_int64.neg_one, + Caml_int64.neg_one, + Caml_int64.neg_one, + Caml_int64.neg_one, + Caml_int64.neg_one, + Caml_int64.neg_one, + Caml_int64.neg_one, + Caml_int64.neg_one, + Caml_int64.neg_one, + Caml_int64.neg_one, + Caml_int64.neg_one, + Caml_int64.neg_one, + Caml_int64.neg_one, + Caml_int64.neg_one, + Caml_int64.neg_one, + Caml_int64.neg_one, + Caml_int64.neg_one, + Caml_int64.neg_one, + Caml_int64.neg_one, + Caml_int64.neg_one, + Caml_int64.neg_one, + Caml_int64.neg_one, + Caml_int64.neg_one, + Caml_int64.neg_one, + Caml_int64.neg_one, + Caml_int64.neg_one, + Caml_int64.neg_one, + Caml_int64.neg_one, + Caml_int64.neg_one, + Caml_int64.neg_one, + Caml_int64.neg_one, + Caml_int64.neg_one, + Caml_int64.neg_one, + Caml_int64.neg_one, + Caml_int64.neg_one, + Caml_int64.neg_one, + Caml_int64.neg_one + ] + }; + }) + ], + tl: { + hd: [ + "mul simple", + (function (param) { + return { + TAG: "Eq", + _0: [ + 0, + 6 + ], + _1: [ + 0, + 6 + ] + }; + }) ], tl: { hd: [ - "asr", + "of_int32", (function (param) { + return { + TAG: "Eq", + _0: $$Array.map(Caml_int64.of_int32, [ + 0, + -2147483648 + ]), + _1: [ + Caml_int64.zero, + [ + -1, + 2147483648 + ] + ] + }; + }) + ], + tl: { + hd: [ + "of_int32_singleton", + (function (param) { return { TAG: "Eq", - _0: $$Array.map((function (x) { - return Caml_int64.asr_(Caml_int64.neg_one, x); - }), $$Array.init(64, (function (i) { - return i; - }))), + _0: [ + -1, + 4294967293 + ], _1: [ - Caml_int64.neg_one, - Caml_int64.neg_one, - Caml_int64.neg_one, - Caml_int64.neg_one, - Caml_int64.neg_one, - Caml_int64.neg_one, - Caml_int64.neg_one, - Caml_int64.neg_one, - Caml_int64.neg_one, - Caml_int64.neg_one, - Caml_int64.neg_one, - Caml_int64.neg_one, - Caml_int64.neg_one, - Caml_int64.neg_one, - Caml_int64.neg_one, - Caml_int64.neg_one, - Caml_int64.neg_one, - Caml_int64.neg_one, - Caml_int64.neg_one, - Caml_int64.neg_one, - Caml_int64.neg_one, - Caml_int64.neg_one, - Caml_int64.neg_one, - Caml_int64.neg_one, - Caml_int64.neg_one, - Caml_int64.neg_one, - Caml_int64.neg_one, - Caml_int64.neg_one, - Caml_int64.neg_one, - Caml_int64.neg_one, - Caml_int64.neg_one, - Caml_int64.neg_one, - Caml_int64.neg_one, - Caml_int64.neg_one, - Caml_int64.neg_one, - Caml_int64.neg_one, - Caml_int64.neg_one, - Caml_int64.neg_one, - Caml_int64.neg_one, - Caml_int64.neg_one, - Caml_int64.neg_one, - Caml_int64.neg_one, - Caml_int64.neg_one, - Caml_int64.neg_one, - Caml_int64.neg_one, - Caml_int64.neg_one, - Caml_int64.neg_one, - Caml_int64.neg_one, - Caml_int64.neg_one, - Caml_int64.neg_one, - Caml_int64.neg_one, - Caml_int64.neg_one, - Caml_int64.neg_one, - Caml_int64.neg_one, - Caml_int64.neg_one, - Caml_int64.neg_one, - Caml_int64.neg_one, - Caml_int64.neg_one, - Caml_int64.neg_one, - Caml_int64.neg_one, - Caml_int64.neg_one, - Caml_int64.neg_one, - Caml_int64.neg_one, - Caml_int64.neg_one + -1, + 4294967293 ] }; }) - ], - tl: { - hd: [ - "mul simple", - (function (param) { + ], + tl: { + hd: [ + "File \"int64_test.res\", line 526, characters 7-14", + (function (param) { return { TAG: "Eq", _0: [ 0, - 6 + 3 ], _1: [ 0, - 6 + 3 ] }; }) - ], - tl: { - hd: [ - "of_int32", - (function (param) { + ], + tl: { + hd: [ + "to_int32", + (function (param) { return { TAG: "Eq", - _0: $$Array.map(Caml_int64.of_int32, [ - 0, - -2147483648 - ]), - _1: [ + _0: $$Array.map(Caml_int64.to_int32, [ Caml_int64.zero, [ - -1, + 0, 2147483648 ] + ]), + _1: [ + 0, + -2147483648 ] }; }) - ], - tl: { - hd: [ - "of_int32_singleton", - (function (param) { - return { - TAG: "Eq", - _0: [ - -1, - 4294967293 - ], - _1: [ - -1, - 4294967293 - ] - }; - }) ], tl: { hd: [ - "File \"int64_test.res\", line 526, characters 7-14", + "discard_sign", (function (param) { + return { + TAG: "Eq", + _0: Caml_int64.discard_sign(Caml_int64.neg_one), + _1: Caml_int64.max_int + }; + }) + ], + tl: { + hd: [ + "div_mod", + (function (param) { return { TAG: "Eq", - _0: [ + _0: Caml_int64.div_mod([ 0, - 3 - ], - _1: [ + 7 + ], [ 0, 3 + ]), + _1: [ + [ + 0, + 2 + ], + Caml_int64.one ] }; }) - ], - tl: { - hd: [ - "to_int32", - (function (param) { - return { - TAG: "Eq", - _0: $$Array.map(Caml_int64.to_int32, [ - Caml_int64.zero, - [ - 0, - 2147483648 - ] - ]), - _1: [ - 0, - -2147483648 - ] - }; - }) ], tl: { hd: [ - "discard_sign", + "to_hex", (function (param) { - return { - TAG: "Eq", - _0: Caml_int64.discard_sign(Caml_int64.neg_one), - _1: Caml_int64.max_int - }; - }) + return { + TAG: "Eq", + _0: Caml_int64.to_hex(Caml_int64.neg_one), + _1: "ffffffffffffffff" + }; + }) ], tl: { hd: [ - "div_mod", + "generic_compare", (function (param) { + return { + TAG: "Eq", + _0: Caml_obj.compare([ + 1, + 0 + ], Caml_int64.one) > 0, + _1: true + }; + }) + ], + tl: { + hd: [ + "test_compier_literal", + (function (param) { return { TAG: "Eq", - _0: Caml_int64.div_mod([ - 0, - 7 - ], [ - 0, - 3 - ]), + _0: [ + 0, + 4294967295 + ], _1: [ - [ - 0, - 2 - ], - Caml_int64.one + 0, + 4294967295 ] }; }) - ], - tl: { - hd: [ - "to_hex", - (function (param) { - return { - TAG: "Eq", - _0: Caml_int64.to_hex(Caml_int64.neg_one), - _1: "ffffffffffffffff" - }; - }) ], tl: { hd: [ - "generic_compare", + "generic_compare2", (function (param) { - return { - TAG: "Eq", - _0: Caml_obj.compare([ - 1, - 0 - ], Caml_int64.one) > 0, - _1: true - }; - }) + return { + TAG: "Eq", + _0: Caml_obj.compare([ + 0, + 2147483648 + ], Caml_int64.one) > 0, + _1: true + }; + }) ], tl: { hd: [ - "test_compier_literal", + "shift_left", (function (param) { + return { + TAG: "Eq", + _0: [ + 0, + 4294967040 + ], + _1: [ + 0, + 4294967040 + ] + }; + }) + ], + tl: { + hd: [ + "fib_int64", + (function (param) { return { TAG: "Eq", - _0: [ + _0: fib(1000, Caml_int64.one, [ 0, - 4294967295 - ], + 2 + ]), _1: [ - 0, - 4294967295 + -1990564327, + 2874523960 ] }; }) - ], - tl: { - hd: [ - "generic_compare2", - (function (param) { - return { - TAG: "Eq", - _0: Caml_obj.compare([ - 0, - 2147483648 - ], Caml_int64.one) > 0, - _1: true - }; - }) ], tl: { hd: [ - "shift_left", + "fac_int64", (function (param) { + return { + TAG: "Eq", + _0: fac(30, Caml_int64.one), + _1: [ + -2040662563, + 1409286144 + ] + }; + }) + ], + tl: { + hd: [ + "File \"int64_test.res\", line 553, characters 8-15", + (function (param) { return { TAG: "Eq", - _0: [ - 0, - 4294967040 - ], + _0: Caml_int64.add(Int64.max_int, Int64.max_int), _1: [ - 0, - 4294967040 + -1, + 4294967294 ] }; }) - ], - tl: { - hd: [ - "fib_int64", - (function (param) { - return { - TAG: "Eq", - _0: fib(1000, Caml_int64.one, [ - 0, - 2 - ]), - _1: [ - -1990564327, - 2874523960 - ] - }; - }) ], tl: { hd: [ - "fac_int64", + "File \"int64_test.res\", line 563, characters 8-15", (function (param) { - return { - TAG: "Eq", - _0: fac(30, Caml_int64.one), - _1: [ - -2040662563, - 1409286144 - ] - }; - }) + return { + TAG: "Eq", + _0: Caml_int64.add(Int64.min_int, Int64.min_int), + _1: Caml_int64.zero + }; + }) ], tl: { hd: [ - "File \"int64_test.res\", line 553, characters 8-15", + "File \"int64_test.res\", line 573, characters 8-15", (function (param) { - return { - TAG: "Eq", - _0: Caml_int64.add(Int64.max_int, Int64.max_int), - _1: [ - -1, - 4294967294 - ] - }; - }) + return { + TAG: "Eq", + _0: Caml_int64.neg_one, + _1: Caml_int64.neg_one + }; + }) ], - tl: { - hd: [ - "File \"int64_test.res\", line 563, characters 8-15", - (function (param) { - return { - TAG: "Eq", - _0: Caml_int64.add(Int64.min_int, Int64.min_int), - _1: Caml_int64.zero - }; - }) - ], - tl: { - hd: [ - "File \"int64_test.res\", line 573, characters 8-15", - (function (param) { - return { - TAG: "Eq", - _0: Caml_int64.neg_one, - _1: Caml_int64.neg_one - }; - }) - ], - tl: /* [] */0 - } - } + tl: /* [] */0 } } } @@ -2098,40 +2096,42 @@ var suites = Pervasives.$at({ } } } - }, Pervasives.$at($$Array.to_list(Ext_array_test.map2i((function (i, a, b) { - return [ - "shift_left_cases " + i, - (function (param) { - return { - TAG: "Eq", - _0: a, - _1: b - }; - }) - ]; - }), shift_left_tests_0, shift_left_tests_1)), Pervasives.$at($$Array.to_list(Ext_array_test.map2i((function (i, a, b) { - return [ - "shift_right_cases " + i, - (function (param) { - return { - TAG: "Eq", - _0: a, - _1: b - }; - }) - ]; - }), shift_right_tests_0, shift_right_tests_1)), $$Array.to_list(Ext_array_test.map2i((function (i, a, b) { - return [ - "shift_right_logical_cases " + i, - (function (param) { - return { - TAG: "Eq", - _0: a, - _1: b - }; - }) - ]; - }), shift_right_logical_suites_0, shift_right_logical_suites_1))))); + } + } +}, Pervasives.$at($$Array.to_list(Ext_array_test.map2i((function (i, a, b) { + return [ + "shift_left_cases " + i, + (function (param) { + return { + TAG: "Eq", + _0: a, + _1: b + }; + }) + ]; +}), shift_left_tests_0, shift_left_tests_1)), Pervasives.$at($$Array.to_list(Ext_array_test.map2i((function (i, a, b) { + return [ + "shift_right_cases " + i, + (function (param) { + return { + TAG: "Eq", + _0: a, + _1: b + }; + }) + ]; +}), shift_right_tests_0, shift_right_tests_1)), $$Array.to_list(Ext_array_test.map2i((function (i, a, b) { + return [ + "shift_right_logical_cases " + i, + (function (param) { + return { + TAG: "Eq", + _0: a, + _1: b + }; + }) + ]; +}), shift_right_logical_suites_0, shift_right_logical_suites_1))))); var suites$1 = { contents: suites @@ -2156,84 +2156,84 @@ function id(loc, x) { } eq("File \"int64_test.res\", line 629, characters 5-12", Caml_int64.bits_of_float(0.3), [ - 1070805811, - 858993459 - ]); + 1070805811, + 858993459 +]); eq("File \"int64_test.res\", line 630, characters 5-12", Caml_int64.float_of_bits([ - 1070805811, - 858993459 - ]), 0.3); + 1070805811, + 858993459 +]), 0.3); id("File \"int64_test.res\", line 631, characters 5-12", Caml_int64.neg_one); id("File \"int64_test.res\", line 632, characters 5-12", [ - -1, - 4294967196 - ]); + -1, + 4294967196 +]); id("File \"int64_test.res\", line 633, characters 5-12", [ - 0, - 4294967295 - ]); + 0, + 4294967295 +]); id("File \"int64_test.res\", line 634, characters 5-12", [ - 0, - 536870911 - ]); + 0, + 536870911 +]); id("File \"int64_test.res\", line 635, characters 5-12", [ - 0, - 536870655 - ]); + 0, + 536870655 +]); eq("File \"int64_test.res\", line 637, characters 4-11", Caml_int64.div(Int64.min_int, [ - 0, - 10 - ]), [ - -214748365, - 858993460 - ]); + 0, + 10 +]), [ + -214748365, + 858993460 +]); eq("File \"int64_test.res\", line 645, characters 4-11", Caml_int64.to_string(Caml_int64.div(Int64.min_int, [ - 0, - 10 - ])), "-922337203685477580"); + 0, + 10 +])), "-922337203685477580"); eq("File \"int64_test.res\", line 653, characters 4-11", Caml_int64.mul(Int64.min_int, [ - 0, - 10 - ]), Caml_int64.zero); + 0, + 10 +]), Caml_int64.zero); eq("File \"int64_test.res\", line 661, characters 4-11", Caml_int64.mul([ - 0, - 10 - ], Int64.min_int), Caml_int64.zero); + 0, + 10 +], Int64.min_int), Caml_int64.zero); eq("File \"int64_test.res\", line 669, characters 4-11", Caml_int64.mul(Caml_int64.one, Int64.min_int), Int64.min_int); eq("File \"int64_test.res\", line 677, characters 4-11", Caml_int64.mul(Int64.max_int, [ - 0, - 10 - ]), [ - -1, - 4294967286 - ]); + 0, + 10 +]), [ + -1, + 4294967286 +]); eq("File \"int64_test.res\", line 685, characters 4-11", Caml_int64.succ(Int64.max_int), Int64.min_int); eq("File \"int64_test.res\", line 693, characters 4-11", Caml_int64.succ(Int64.min_int), [ - -2147483648, - 1 - ]); + -2147483648, + 1 +]); eq("File \"int64_test.res\", line 700, characters 5-12", Caml_int64.succ([ - 0, - 4294967295 - ]), [ - 1, - 0 - ]); + 0, + 4294967295 +]), [ + 1, + 0 +]); Mt.from_pair_suites("Int64_test", suites$1.contents); diff --git a/jscomp/test/int_hashtbl_test.js b/jscomp/test/int_hashtbl_test.js index aa4d2dd1cf..db5a30f52c 100644 --- a/jscomp/test/int_hashtbl_test.js +++ b/jscomp/test/int_hashtbl_test.js @@ -13,16 +13,16 @@ function f(H) { Curry._3(H.add, tbl, 1, /* '1' */49); Curry._3(H.add, tbl, 2, /* '2' */50); return List.sort((function (param, param$1) { - return Caml.int_compare(param[0], param$1[0]); - }), Curry._3(H.fold, (function (k, v, acc) { - return { - hd: [ - k, - v - ], - tl: acc - }; - }), tbl, /* [] */0)); + return Caml.int_compare(param[0], param$1[0]); + }), Curry._3(H.fold, (function (k, v, acc) { + return { + hd: [ + k, + v + ], + tl: acc + }; + }), tbl, /* [] */0)); } function g(H, count) { @@ -34,17 +34,17 @@ function g(H, count) { Curry._3(H.replace, tbl, (i$1 << 1), String(i$1)); } var v = Curry._3(H.fold, (function (k, v, acc) { - return { - hd: [ - k, - v - ], - tl: acc - }; - }), tbl, /* [] */0); + return { + hd: [ + k, + v + ], + tl: acc + }; + }), tbl, /* [] */0); return $$Array.of_list(List.sort((function (param, param$1) { - return Caml.int_compare(param[0], param$1[0]); - }), v)); + return Caml.int_compare(param[0], param$1[0]); + }), v)); } var hash = Hashtbl.hash; @@ -54,48 +54,48 @@ function equal(x, y) { } var Int_hash = Hashtbl.Make({ - equal: equal, - hash: hash - }); + equal: equal, + hash: hash +}); var suites_0 = [ "simple", (function (param) { - return { - TAG: "Eq", - _0: { + return { + TAG: "Eq", + _0: { + hd: [ + 1, + /* '1' */49 + ], + tl: { hd: [ - 1, - /* '1' */49 + 2, + /* '2' */50 ], - tl: { - hd: [ - 2, - /* '2' */50 - ], - tl: /* [] */0 - } - }, - _1: f(Int_hash) - }; - }) + tl: /* [] */0 + } + }, + _1: f(Int_hash) + }; + }) ]; var suites_1 = { hd: [ "more_iterations", (function (param) { - return { - TAG: "Eq", - _0: $$Array.init(1001, (function (i) { - return [ - (i << 1), - String(i) - ]; - })), - _1: g(Int_hash, 1000) - }; - }) + return { + TAG: "Eq", + _0: $$Array.init(1001, (function (i) { + return [ + (i << 1), + String(i) + ]; + })), + _1: g(Int_hash, 1000) + }; + }) ], tl: /* [] */0 }; diff --git a/jscomp/test/int_overflow_test.js b/jscomp/test/int_overflow_test.js index be0b0dc37d..458cd8f32f 100644 --- a/jscomp/test/int_overflow_test.js +++ b/jscomp/test/int_overflow_test.js @@ -39,162 +39,160 @@ function fib(x) { } Mt.from_pair_suites("Int_overflow_test", { + hd: [ + "plus_overflow", + (function (param) { + return { + TAG: "Eq", + _0: true, + _1: (Int32.max_int + 1 | 0) === Int32.min_int + }; + }) + ], + tl: { + hd: [ + "minus_overflow", + (function (param) { + return { + TAG: "Eq", + _0: true, + _1: (Int32.min_int - Int32.one | 0) === Int32.max_int + }; + }) + ], + tl: { hd: [ - "plus_overflow", + "flow_again", (function (param) { - return { - TAG: "Eq", - _0: true, - _1: (Int32.max_int + 1 | 0) === Int32.min_int - }; - }) + return { + TAG: "Eq", + _0: 2147483646, + _1: (Int32.max_int + Int32.max_int | 0) + Int32.min_int | 0 + }; + }) ], tl: { hd: [ - "minus_overflow", + "flow_again", (function (param) { - return { - TAG: "Eq", - _0: true, - _1: (Int32.min_int - Int32.one | 0) === Int32.max_int - }; - }) + return { + TAG: "Eq", + _0: -2, + _1: Int32.max_int + Int32.max_int | 0 + }; + }) ], tl: { hd: [ - "flow_again", + "hash_test", (function (param) { - return { - TAG: "Eq", - _0: 2147483646, - _1: (Int32.max_int + Int32.max_int | 0) + Int32.min_int | 0 - }; - }) + return { + TAG: "Eq", + _0: hash_variant("xxyyzzuuxxzzyy00112233"), + _1: 544087776 + }; + }) ], tl: { hd: [ - "flow_again", + "hash_test2", (function (param) { - return { - TAG: "Eq", - _0: -2, - _1: Int32.max_int + Int32.max_int | 0 - }; - }) + return { + TAG: "Eq", + _0: hash_variant("xxyyzxzzyy"), + _1: -449896130 + }; + }) ], tl: { hd: [ - "hash_test", + "File \"int_overflow_test.res\", line 88, characters 5-12", (function (param) { - return { - TAG: "Eq", - _0: hash_variant("xxyyzzuuxxzzyy00112233"), - _1: 544087776 - }; - }) + return { + TAG: "Eq", + _0: hash_variant2("xxyyzzuuxxzzyy00112233"), + _1: 544087776 + }; + }) ], tl: { hd: [ - "hash_test2", + "File \"int_overflow_test.res\", line 89, characters 5-12", (function (param) { - return { - TAG: "Eq", - _0: hash_variant("xxyyzxzzyy"), - _1: -449896130 - }; - }) + return { + TAG: "Eq", + _0: hash_variant2("xxyyzxzzyy"), + _1: -449896130 + }; + }) ], tl: { hd: [ - "File \"int_overflow_test.res\", line 88, characters 5-12", + "int_literal_flow", (function (param) { - return { - TAG: "Eq", - _0: hash_variant2("xxyyzzuuxxzzyy00112233"), - _1: 544087776 - }; - }) + return { + TAG: "Eq", + _0: -1, + _1: -1 + }; + }) ], tl: { hd: [ - "File \"int_overflow_test.res\", line 89, characters 5-12", + "int_literal_flow2", (function (param) { - return { - TAG: "Eq", - _0: hash_variant2("xxyyzxzzyy"), - _1: -449896130 - }; - }) + return { + TAG: "Eq", + _0: -1, + _1: -1 + }; + }) ], tl: { hd: [ - "int_literal_flow", + "int_literal_flow3", (function (param) { - return { - TAG: "Eq", - _0: -1, - _1: -1 - }; - }) + return { + TAG: "Eq", + _0: -1, + _1: -1 + }; + }) ], tl: { hd: [ - "int_literal_flow2", + "int32_mul", (function (param) { - return { - TAG: "Eq", - _0: -1, - _1: -1 - }; - }) + return { + TAG: "Eq", + _0: -33554431, + _1: -33554431 + }; + }) ], tl: { hd: [ - "int_literal_flow3", + "File \"int_overflow_test.res\", line 94, characters 5-12", (function (param) { - return { - TAG: "Eq", - _0: -1, - _1: -1 - }; - }) + return { + TAG: "Eq", + _0: Number("3") | 0, + _1: 3 + }; + }) ], tl: { hd: [ - "int32_mul", + "File \"int_overflow_test.res\", line 96, characters 5-12", (function (param) { - return { - TAG: "Eq", - _0: -33554431, - _1: -33554431 - }; - }) + return { + TAG: "Eq", + _0: Number("3.2") | 0, + _1: 3 + }; + }) ], - tl: { - hd: [ - "File \"int_overflow_test.res\", line 94, characters 5-12", - (function (param) { - return { - TAG: "Eq", - _0: Number("3") | 0, - _1: 3 - }; - }) - ], - tl: { - hd: [ - "File \"int_overflow_test.res\", line 96, characters 5-12", - (function (param) { - return { - TAG: "Eq", - _0: Number("3.2") | 0, - _1: 3 - }; - }) - ], - tl: /* [] */0 - } - } + tl: /* [] */0 } } } @@ -206,7 +204,9 @@ Mt.from_pair_suites("Int_overflow_test", { } } } - }); + } + } +}); exports.hash_variant = hash_variant; exports.hash_variant2 = hash_variant2; diff --git a/jscomp/test/int_poly_var.js b/jscomp/test/int_poly_var.js index 80818b0842..9ddc994b3f 100644 --- a/jscomp/test/int_poly_var.js +++ b/jscomp/test/int_poly_var.js @@ -71,55 +71,55 @@ var hihi = f3(3, 0); var hh10 = "3" === 3; var tuple_0 = nest({ - TAG: "A", - _0: 0 - }); + TAG: "A", + _0: 0 +}); var tuple_1 = nest({ - TAG: "A", - _0: 1 - }); + TAG: "A", + _0: 1 +}); var tuple_2 = nest({ - TAG: "A", - _0: 2 - }); + TAG: "A", + _0: 2 +}); var tuple_3 = nest({ - TAG: "B", - _0: 1, - _1: 0 - }); + TAG: "B", + _0: 1, + _1: 0 +}); var tuple_4 = nest({ - TAG: "B", - _0: 1, - _1: 1 - }); + TAG: "B", + _0: 1, + _1: 1 +}); var tuple_5 = nest({ - TAG: "B", - _0: 2, - _1: 1 - }); + TAG: "B", + _0: 2, + _1: 1 +}); var tuple_6 = nest({ - TAG: "B", - _0: 2, - _1: 2 - }); + TAG: "B", + _0: 2, + _1: 2 +}); var tuple_7 = nest({ - TAG: "B", - _0: 0, - _1: 0 - }); + TAG: "B", + _0: 0, + _1: 0 +}); var tuple_8 = nest({ - TAG: "B", - _0: 0, - _1: 1 - }); + TAG: "B", + _0: 0, + _1: 1 +}); var tuple = [ tuple_0, @@ -138,18 +138,18 @@ var tuple = [ Mt.eq_suites(test_id, suites, "File \"int_poly_var.res\", line 79, characters 29-36", hihi, 3); Mt.eq_suites(test_id, suites, "File \"int_poly_var.res\", line 80, characters 29-36", tuple, [ - 0, - 1, - 2, - 3, - 4, - 5, - 5, - 3, - 6, - true, - false - ]); + 0, + 1, + 2, + 3, + 4, + 5, + 5, + 3, + 6, + true, + false +]); function hh0(x) { return x; diff --git a/jscomp/test/int_switch_test.js b/jscomp/test/int_switch_test.js index a2b1c73545..1294df8ad9 100644 --- a/jscomp/test/int_switch_test.js +++ b/jscomp/test/int_switch_test.js @@ -64,24 +64,24 @@ function f33(x) { } eq("File \"int_switch_test.res\", line 32, characters 3-10", f(function (param) { - return 1; - }), /* 'a' */97); + return 1; +}), /* 'a' */97); eq("File \"int_switch_test.res\", line 33, characters 3-10", f(function (param) { - return 2; - }), /* 'b' */98); + return 2; +}), /* 'b' */98); eq("File \"int_switch_test.res\", line 34, characters 3-10", f(function (param) { - return 3; - }), /* 'c' */99); + return 3; +}), /* 'c' */99); eq("File \"int_switch_test.res\", line 35, characters 3-10", f(function (param) { - return 0; - }), /* 'x' */120); + return 0; +}), /* 'x' */120); eq("File \"int_switch_test.res\", line 36, characters 3-10", f(function (param) { - return -1; - }), /* 'x' */120); + return -1; +}), /* 'x' */120); Mt.from_pair_suites("Int_switch_test", suites.contents); diff --git a/jscomp/test/js_array_test.js b/jscomp/test/js_array_test.js index 3ae7c9b99c..eeb489b293 100644 --- a/jscomp/test/js_array_test.js +++ b/jscomp/test/js_array_test.js @@ -8,6 +8,30 @@ var Caml_option = require("../../lib/js/caml_option.js"); var suites_0 = [ "File \"js_array_test.res\", line 5, characters 6-13", (function (param) { + var x = [ + 1, + 2, + 3, + 4, + 5 + ]; + return { + TAG: "Eq", + _0: [ + 2, + 4 + ], + _1: (Js_vector.filterInPlace((function (x) { + return x % 2 === 0; + }), x), x) + }; + }) +]; + +var suites_1 = { + hd: [ + "File \"js_array_test.res\", line 16, characters 6-13", + (function (param) { var x = [ 1, 2, @@ -17,363 +41,369 @@ var suites_0 = [ ]; return { TAG: "Eq", - _0: [ - 2, - 4 - ], + _0: true, _1: (Js_vector.filterInPlace((function (x) { - return x % 2 === 0; - }), x), x) + return x > 10; + }), x), x.length === 0) }; }) -]; - -var suites_1 = { - hd: [ - "File \"js_array_test.res\", line 16, characters 6-13", - (function (param) { - var x = [ - 1, - 2, - 3, - 4, - 5 - ]; - return { - TAG: "Eq", - _0: true, - _1: (Js_vector.filterInPlace((function (x) { - return x > 10; - }), x), x.length === 0) - }; - }) ], tl: { hd: [ "isArray_array", (function (param) { - return { - TAG: "Eq", - _0: true, - _1: Array.isArray([]) - }; - }) + return { + TAG: "Eq", + _0: true, + _1: Array.isArray([]) + }; + }) ], tl: { hd: [ "isArray_int", (function (param) { - return { - TAG: "Eq", - _0: false, - _1: Array.isArray(34) - }; - }) + return { + TAG: "Eq", + _0: false, + _1: Array.isArray(34) + }; + }) ], tl: { hd: [ "length", (function (param) { + return { + TAG: "Eq", + _0: 3, + _1: [ + 1, + 2, + 3 + ].length + }; + }) + ], + tl: { + hd: [ + "copyWithin", + (function (param) { return { TAG: "Eq", - _0: 3, + _0: [ + 1, + 2, + 3, + 1, + 2 + ], _1: [ 1, 2, - 3 - ].length + 3, + 4, + 5 + ].copyWithin(-2) }; }) - ], - tl: { - hd: [ - "copyWithin", - (function (param) { + ], + tl: { + hd: [ + "copyWithinFrom", + (function (param) { return { TAG: "Eq", _0: [ - 1, - 2, + 4, + 5, 3, - 1, - 2 + 4, + 5 ], _1: [ - 1, - 2, - 3, - 4, - 5 - ].copyWithin(-2) + 1, + 2, + 3, + 4, + 5 + ].copyWithin(0, 3) }; }) - ], - tl: { - hd: [ - "copyWithinFrom", - (function (param) { + ], + tl: { + hd: [ + "copyWithinFromRange", + (function (param) { return { TAG: "Eq", _0: [ 4, - 5, + 2, 3, 4, 5 ], _1: [ - 1, - 2, - 3, - 4, - 5 - ].copyWithin(0, 3) + 1, + 2, + 3, + 4, + 5 + ].copyWithin(0, 3, 4) }; }) - ], - tl: { - hd: [ - "copyWithinFromRange", - (function (param) { + ], + tl: { + hd: [ + "fillInPlace", + (function (param) { return { TAG: "Eq", _0: [ 4, - 2, - 3, 4, - 5 + 4 ], _1: [ - 1, - 2, - 3, - 4, - 5 - ].copyWithin(0, 3, 4) + 1, + 2, + 3 + ].fill(4) }; }) - ], - tl: { - hd: [ - "fillInPlace", - (function (param) { + ], + tl: { + hd: [ + "fillFromInPlace", + (function (param) { return { TAG: "Eq", _0: [ - 4, + 1, 4, 4 ], _1: [ - 1, - 2, - 3 - ].fill(4) + 1, + 2, + 3 + ].fill(4, 1) }; }) - ], - tl: { - hd: [ - "fillFromInPlace", - (function (param) { + ], + tl: { + hd: [ + "fillRangeInPlace", + (function (param) { return { TAG: "Eq", _0: [ 1, 4, - 4 + 3 ], _1: [ - 1, - 2, - 3 - ].fill(4, 1) + 1, + 2, + 3 + ].fill(4, 1, 2) }; }) - ], - tl: { - hd: [ - "fillRangeInPlace", - (function (param) { + ], + tl: { + hd: [ + "pop", + (function (param) { return { TAG: "Eq", - _0: [ + _0: 3, + _1: Caml_option.undefined_to_opt([ 1, - 4, + 2, 3 - ], - _1: [ - 1, - 2, - 3 - ].fill(4, 1, 2) + ].pop()) }; }) - ], - tl: { - hd: [ - "pop", - (function (param) { - return { - TAG: "Eq", - _0: 3, - _1: Caml_option.undefined_to_opt([ - 1, - 2, - 3 - ].pop()) - }; - }) ], tl: { hd: [ "pop - empty array", (function (param) { - return { - TAG: "Eq", - _0: undefined, - _1: Caml_option.undefined_to_opt([].pop()) - }; - }) + return { + TAG: "Eq", + _0: undefined, + _1: Caml_option.undefined_to_opt([].pop()) + }; + }) ], tl: { hd: [ "push", (function (param) { - return { - TAG: "Eq", - _0: 4, - _1: [ - 1, - 2, - 3 - ].push(4) - }; - }) + return { + TAG: "Eq", + _0: 4, + _1: [ + 1, + 2, + 3 + ].push(4) + }; + }) ], tl: { hd: [ "pushMany", (function (param) { - return { - TAG: "Eq", - _0: 5, - _1: [ - 1, - 2, - 3 - ].push(4, 5) - }; - }) + return { + TAG: "Eq", + _0: 5, + _1: [ + 1, + 2, + 3 + ].push(4, 5) + }; + }) ], tl: { hd: [ "reverseInPlace", (function (param) { - return { - TAG: "Eq", - _0: [ - 3, - 2, - 1 - ], - _1: [ - 1, - 2, - 3 - ].reverse() - }; - }) + return { + TAG: "Eq", + _0: [ + 3, + 2, + 1 + ], + _1: [ + 1, + 2, + 3 + ].reverse() + }; + }) ], tl: { hd: [ "shift", (function (param) { - return { - TAG: "Eq", - _0: 1, - _1: Caml_option.undefined_to_opt([ - 1, - 2, - 3 - ].shift()) - }; - }) + return { + TAG: "Eq", + _0: 1, + _1: Caml_option.undefined_to_opt([ + 1, + 2, + 3 + ].shift()) + }; + }) ], tl: { hd: [ "shift - empty array", (function (param) { - return { - TAG: "Eq", - _0: undefined, - _1: Caml_option.undefined_to_opt([].shift()) - }; - }) + return { + TAG: "Eq", + _0: undefined, + _1: Caml_option.undefined_to_opt([].shift()) + }; + }) ], tl: { hd: [ "sortInPlace", (function (param) { + return { + TAG: "Eq", + _0: [ + 1, + 2, + 3 + ], + _1: [ + 3, + 1, + 2 + ].sort() + }; + }) + ], + tl: { + hd: [ + "sortInPlaceWith", + (function (param) { return { TAG: "Eq", _0: [ - 1, + 3, 2, - 3 + 1 ], _1: [ - 3, - 1, - 2 - ].sort() + 3, + 1, + 2 + ].sort(function (a, b) { + return b - a | 0; + }) }; }) - ], - tl: { - hd: [ - "sortInPlaceWith", - (function (param) { - return { - TAG: "Eq", - _0: [ - 3, - 2, - 1 - ], - _1: [ - 3, - 1, - 2 - ].sort(function (a, b) { - return b - a | 0; - }) - }; - }) ], tl: { hd: [ "spliceInPlace", (function (param) { + var arr = [ + 1, + 2, + 3, + 4 + ]; + var removed = arr.splice(2, 0, 5); + return { + TAG: "Eq", + _0: [ + [ + 1, + 2, + 5, + 3, + 4 + ], + [] + ], + _1: [ + arr, + removed + ] + }; + }) + ], + tl: { + hd: [ + "removeFromInPlace", + (function (param) { var arr = [ 1, 2, 3, 4 ]; - var removed = arr.splice(2, 0, 5); + var removed = arr.splice(2); return { TAG: "Eq", _0: [ [ 1, - 2, - 5, + 2 + ], + [ 3, 4 - ], - [] + ] ], _1: [ arr, @@ -381,29 +411,27 @@ var suites_1 = { ] }; }) - ], - tl: { - hd: [ - "removeFromInPlace", - (function (param) { + ], + tl: { + hd: [ + "removeCountInPlace", + (function (param) { var arr = [ 1, 2, 3, 4 ]; - var removed = arr.splice(2); + var removed = arr.splice(2, 1); return { TAG: "Eq", _0: [ [ 1, - 2 - ], - [ - 3, + 2, 4 - ] + ], + [3] ], _1: [ arr, @@ -411,89 +439,85 @@ var suites_1 = { ] }; }) - ], - tl: { - hd: [ - "removeCountInPlace", - (function (param) { - var arr = [ - 1, - 2, - 3, - 4 - ]; - var removed = arr.splice(2, 1); - return { - TAG: "Eq", - _0: [ - [ - 1, - 2, - 4 - ], - [3] - ], - _1: [ - arr, - removed - ] - }; - }) ], tl: { hd: [ "unshift", (function (param) { - return { - TAG: "Eq", - _0: 4, - _1: [ - 1, - 2, - 3 - ].unshift(4) - }; - }) + return { + TAG: "Eq", + _0: 4, + _1: [ + 1, + 2, + 3 + ].unshift(4) + }; + }) ], tl: { hd: [ "unshiftMany", (function (param) { - return { - TAG: "Eq", - _0: 5, - _1: [ - 1, - 2, - 3 - ].unshift(4, 5) - }; - }) + return { + TAG: "Eq", + _0: 5, + _1: [ + 1, + 2, + 3 + ].unshift(4, 5) + }; + }) ], tl: { hd: [ "append", (function (param) { + return { + TAG: "Eq", + _0: [ + 1, + 2, + 3, + 4 + ], + _1: [ + 1, + 2, + 3 + ].concat([4]) + }; + }) + ], + tl: { + hd: [ + "concat", + (function (param) { return { TAG: "Eq", _0: [ 1, 2, 3, - 4 + 4, + 5 ], _1: [ - 1, - 2, - 3 - ].concat([4]) + 1, + 2, + 3 + ].concat([ + 4, + 5 + ]) }; }) - ], - tl: { - hd: [ - "concat", - (function (param) { + ], + tl: { + hd: [ + "concatMany", + (function (param) { return { TAG: "Eq", _0: [ @@ -501,628 +525,604 @@ var suites_1 = { 2, 3, 4, - 5 + 5, + 6, + 7 ], _1: [ - 1, - 2, - 3 - ].concat([ - 4, - 5 - ]) + 1, + 2, + 3 + ].concat([ + 4, + 5 + ], [ + 6, + 7 + ]) }; }) - ], - tl: { - hd: [ - "concatMany", - (function (param) { + ], + tl: { + hd: [ + "includes", + (function (param) { return { TAG: "Eq", - _0: [ + _0: true, + _1: [ 1, 2, - 3, - 4, - 5, - 6, - 7 - ], - _1: [ - 1, - 2, - 3 - ].concat([ - 4, - 5 - ], [ - 6, - 7 - ]) + 3 + ].includes(3) }; }) - ], - tl: { - hd: [ - "includes", - (function (param) { - return { - TAG: "Eq", - _0: true, - _1: [ - 1, - 2, - 3 - ].includes(3) - }; - }) ], tl: { hd: [ "indexOf", (function (param) { - return { - TAG: "Eq", - _0: 1, - _1: [ - 1, - 2, - 3 - ].indexOf(2) - }; - }) + return { + TAG: "Eq", + _0: 1, + _1: [ + 1, + 2, + 3 + ].indexOf(2) + }; + }) ], tl: { hd: [ "indexOfFrom", (function (param) { - return { - TAG: "Eq", - _0: 3, - _1: [ - 1, - 2, - 3, - 2 - ].indexOf(2, 2) - }; - }) + return { + TAG: "Eq", + _0: 3, + _1: [ + 1, + 2, + 3, + 2 + ].indexOf(2, 2) + }; + }) ], tl: { hd: [ "join", (function (param) { - return { - TAG: "Eq", - _0: "1,2,3", - _1: [ - 1, - 2, - 3 - ].join() - }; - }) + return { + TAG: "Eq", + _0: "1,2,3", + _1: [ + 1, + 2, + 3 + ].join() + }; + }) ], tl: { hd: [ "joinWith", (function (param) { - return { - TAG: "Eq", - _0: "1;2;3", - _1: [ - 1, - 2, - 3 - ].join(";") - }; - }) + return { + TAG: "Eq", + _0: "1;2;3", + _1: [ + 1, + 2, + 3 + ].join(";") + }; + }) ], tl: { hd: [ "lastIndexOf", (function (param) { + return { + TAG: "Eq", + _0: 1, + _1: [ + 1, + 2, + 3 + ].lastIndexOf(2) + }; + }) + ], + tl: { + hd: [ + "lastIndexOfFrom", + (function (param) { return { TAG: "Eq", _0: 1, _1: [ - 1, - 2, - 3 - ].lastIndexOf(2) + 1, + 2, + 3, + 2 + ].lastIndexOf(2, 2) }; }) - ], - tl: { - hd: [ - "lastIndexOfFrom", - (function (param) { - return { - TAG: "Eq", - _0: 1, - _1: [ - 1, - 2, - 3, - 2 - ].lastIndexOf(2, 2) - }; - }) ], tl: { hd: [ "slice", (function (param) { - return { - TAG: "Eq", - _0: [ - 2, - 3 - ], - _1: [ - 1, - 2, - 3, - 4, - 5 - ].slice(1, 3) - }; - }) + return { + TAG: "Eq", + _0: [ + 2, + 3 + ], + _1: [ + 1, + 2, + 3, + 4, + 5 + ].slice(1, 3) + }; + }) ], tl: { hd: [ "copy", (function (param) { + return { + TAG: "Eq", + _0: [ + 1, + 2, + 3, + 4, + 5 + ], + _1: [ + 1, + 2, + 3, + 4, + 5 + ].slice() + }; + }) + ], + tl: { + hd: [ + "sliceFrom", + (function (param) { return { TAG: "Eq", _0: [ - 1, - 2, 3, 4, 5 ], _1: [ - 1, - 2, - 3, - 4, - 5 - ].slice() + 1, + 2, + 3, + 4, + 5 + ].slice(2) }; }) - ], - tl: { - hd: [ - "sliceFrom", - (function (param) { - return { - TAG: "Eq", - _0: [ - 3, - 4, - 5 - ], - _1: [ - 1, - 2, - 3, - 4, - 5 - ].slice(2) - }; - }) ], tl: { hd: [ "toString", (function (param) { + return { + TAG: "Eq", + _0: "1,2,3", + _1: [ + 1, + 2, + 3 + ].toString() + }; + }) + ], + tl: { + hd: [ + "toLocaleString", + (function (param) { return { TAG: "Eq", _0: "1,2,3", _1: [ - 1, - 2, - 3 - ].toString() + 1, + 2, + 3 + ].toLocaleString() }; }) - ], - tl: { - hd: [ - "toLocaleString", - (function (param) { - return { - TAG: "Eq", - _0: "1,2,3", - _1: [ - 1, - 2, - 3 - ].toLocaleString() - }; - }) ], tl: { hd: [ "every", (function (param) { - return { - TAG: "Eq", - _0: true, - _1: [ - 1, - 2, - 3 - ].every(function (n) { - return n > 0; - }) - }; - }) + return { + TAG: "Eq", + _0: true, + _1: [ + 1, + 2, + 3 + ].every(function (n) { + return n > 0; + }) + }; + }) ], tl: { hd: [ "everyi", (function (param) { - return { - TAG: "Eq", - _0: false, - _1: [ - 1, - 2, - 3 - ].every(function (param, i) { - return i > 0; - }) - }; - }) + return { + TAG: "Eq", + _0: false, + _1: [ + 1, + 2, + 3 + ].every(function (param, i) { + return i > 0; + }) + }; + }) ], tl: { hd: [ "filter", (function (param) { + return { + TAG: "Eq", + _0: [ + 2, + 4 + ], + _1: [ + 1, + 2, + 3, + 4 + ].filter(function (n) { + return n % 2 === 0; + }) + }; + }) + ], + tl: { + hd: [ + "filteri", + (function (param) { return { TAG: "Eq", _0: [ - 2, - 4 + 1, + 3 ], _1: [ - 1, - 2, - 3, - 4 - ].filter(function (n) { - return n % 2 === 0; - }) + 1, + 2, + 3, + 4 + ].filter(function (param, i) { + return i % 2 === 0; + }) }; }) - ], - tl: { - hd: [ - "filteri", - (function (param) { - return { - TAG: "Eq", - _0: [ - 1, - 3 - ], - _1: [ - 1, - 2, - 3, - 4 - ].filter(function (param, i) { - return i % 2 === 0; - }) - }; - }) ], tl: { hd: [ "find", (function (param) { - return { - TAG: "Eq", - _0: 2, - _1: Caml_option.undefined_to_opt([ - 1, - 2, - 3, - 4 - ].find(function (n) { - return n % 2 === 0; - })) - }; - }) + return { + TAG: "Eq", + _0: 2, + _1: Caml_option.undefined_to_opt([ + 1, + 2, + 3, + 4 + ].find(function (n) { + return n % 2 === 0; + })) + }; + }) ], tl: { hd: [ "find - no match", (function (param) { - return { - TAG: "Eq", - _0: undefined, - _1: Caml_option.undefined_to_opt([ - 1, - 2, - 3, - 4 - ].find(function (n) { - return n % 2 === 5; - })) - }; - }) + return { + TAG: "Eq", + _0: undefined, + _1: Caml_option.undefined_to_opt([ + 1, + 2, + 3, + 4 + ].find(function (n) { + return n % 2 === 5; + })) + }; + }) ], tl: { hd: [ "findi", (function (param) { - return { - TAG: "Eq", - _0: 1, - _1: Caml_option.undefined_to_opt([ - 1, - 2, - 3, - 4 - ].find(function (param, i) { - return i % 2 === 0; - })) - }; - }) + return { + TAG: "Eq", + _0: 1, + _1: Caml_option.undefined_to_opt([ + 1, + 2, + 3, + 4 + ].find(function (param, i) { + return i % 2 === 0; + })) + }; + }) ], tl: { hd: [ "findi - no match", (function (param) { - return { - TAG: "Eq", - _0: undefined, - _1: Caml_option.undefined_to_opt([ - 1, - 2, - 3, - 4 - ].find(function (param, i) { - return i % 2 === 5; - })) - }; - }) + return { + TAG: "Eq", + _0: undefined, + _1: Caml_option.undefined_to_opt([ + 1, + 2, + 3, + 4 + ].find(function (param, i) { + return i % 2 === 5; + })) + }; + }) ], tl: { hd: [ "findIndex", (function (param) { - return { - TAG: "Eq", - _0: 1, - _1: [ - 1, - 2, - 3, - 4 - ].findIndex(function (n) { - return n % 2 === 0; - }) - }; - }) + return { + TAG: "Eq", + _0: 1, + _1: [ + 1, + 2, + 3, + 4 + ].findIndex(function (n) { + return n % 2 === 0; + }) + }; + }) ], tl: { hd: [ "findIndexi", (function (param) { - return { - TAG: "Eq", - _0: 0, - _1: [ - 1, - 2, - 3, - 4 - ].findIndex(function (param, i) { - return i % 2 === 0; - }) - }; - }) + return { + TAG: "Eq", + _0: 0, + _1: [ + 1, + 2, + 3, + 4 + ].findIndex(function (param, i) { + return i % 2 === 0; + }) + }; + }) ], tl: { hd: [ "forEach", (function (param) { + var sum = { + contents: 0 + }; + [ + 1, + 2, + 3 + ].forEach(function (n) { + sum.contents = sum.contents + n | 0; + }); + return { + TAG: "Eq", + _0: 6, + _1: sum.contents + }; + }) + ], + tl: { + hd: [ + "forEachi", + (function (param) { var sum = { contents: 0 }; [ - 1, - 2, - 3 - ].forEach(function (n) { - sum.contents = sum.contents + n | 0; - }); + 1, + 2, + 3 + ].forEach(function (param, i) { + sum.contents = sum.contents + i | 0; + }); return { TAG: "Eq", - _0: 6, + _0: 3, _1: sum.contents }; }) - ], - tl: { - hd: [ - "forEachi", - (function (param) { - var sum = { - contents: 0 - }; - [ - 1, - 2, - 3 - ].forEach(function (param, i) { - sum.contents = sum.contents + i | 0; - }); - return { - TAG: "Eq", - _0: 3, - _1: sum.contents - }; - }) ], tl: { hd: [ "map", (function (param) { + return { + TAG: "Eq", + _0: [ + 2, + 4, + 6, + 8 + ], + _1: [ + 1, + 2, + 3, + 4 + ].map(function (n) { + return (n << 1); + }) + }; + }) + ], + tl: { + hd: [ + "map", + (function (param) { return { TAG: "Eq", _0: [ + 0, 2, 4, - 6, - 8 + 6 ], _1: [ - 1, - 2, - 3, - 4 - ].map(function (n) { - return (n << 1); - }) + 1, + 2, + 3, + 4 + ].map(function (param, i) { + return (i << 1); + }) }; }) - ], - tl: { - hd: [ - "map", - (function (param) { - return { - TAG: "Eq", - _0: [ - 0, - 2, - 4, - 6 - ], - _1: [ - 1, - 2, - 3, - 4 - ].map(function (param, i) { - return (i << 1); - }) - }; - }) ], tl: { hd: [ "reduce", (function (param) { - return { - TAG: "Eq", - _0: -10, - _1: [ - 1, - 2, - 3, - 4 - ].reduce((function (acc, n) { - return acc - n | 0; - }), 0) - }; - }) + return { + TAG: "Eq", + _0: -10, + _1: [ + 1, + 2, + 3, + 4 + ].reduce((function (acc, n) { + return acc - n | 0; + }), 0) + }; + }) ], tl: { hd: [ "reducei", (function (param) { - return { - TAG: "Eq", - _0: -6, - _1: [ - 1, - 2, - 3, - 4 - ].reduce((function (acc, param, i) { - return acc - i | 0; - }), 0) - }; - }) + return { + TAG: "Eq", + _0: -6, + _1: [ + 1, + 2, + 3, + 4 + ].reduce((function (acc, param, i) { + return acc - i | 0; + }), 0) + }; + }) ], tl: { hd: [ "reduceRight", (function (param) { - return { - TAG: "Eq", - _0: -10, - _1: [ - 1, - 2, - 3, - 4 - ].reduceRight((function (acc, n) { - return acc - n | 0; - }), 0) - }; - }) + return { + TAG: "Eq", + _0: -10, + _1: [ + 1, + 2, + 3, + 4 + ].reduceRight((function (acc, n) { + return acc - n | 0; + }), 0) + }; + }) ], tl: { hd: [ "reduceRighti", (function (param) { - return { - TAG: "Eq", - _0: -6, - _1: [ - 1, - 2, - 3, - 4 - ].reduceRight((function (acc, param, i) { - return acc - i | 0; - }), 0) - }; - }) + return { + TAG: "Eq", + _0: -6, + _1: [ + 1, + 2, + 3, + 4 + ].reduceRight((function (acc, param, i) { + return acc - i | 0; + }), 0) + }; + }) ], tl: { hd: [ "some", (function (param) { - return { - TAG: "Eq", - _0: false, - _1: [ - 1, - 2, - 3, - 4 - ].some(function (n) { - return n <= 0; - }) - }; - }) + return { + TAG: "Eq", + _0: false, + _1: [ + 1, + 2, + 3, + 4 + ].some(function (n) { + return n <= 0; + }) + }; + }) ], tl: { hd: [ "somei", (function (param) { - return { - TAG: "Eq", - _0: true, - _1: [ - 1, - 2, - 3, - 4 - ].some(function (param, i) { - return i <= 0; - }) - }; - }) + return { + TAG: "Eq", + _0: true, + _1: [ + 1, + 2, + 3, + 4 + ].some(function (param, i) { + return i <= 0; + }) + }; + }) ], tl: /* [] */0 } diff --git a/jscomp/test/js_bool_test.js b/jscomp/test/js_bool_test.js index 5afc6af95a..cde1d0b4e4 100644 --- a/jscomp/test/js_bool_test.js +++ b/jscomp/test/js_bool_test.js @@ -34,35 +34,35 @@ var v = true; var suites_0 = [ "?bool_eq_caml_bool", (function (param) { - return { - TAG: "Eq", - _0: u, - _1: true - }; - }) + return { + TAG: "Eq", + _0: u, + _1: true + }; + }) ]; var suites_1 = { hd: [ "js_bool_eq_js_bool", (function (param) { - return { - TAG: "Eq", - _0: v, - _1: true - }; - }) + return { + TAG: "Eq", + _0: v, + _1: true + }; + }) ], tl: { hd: [ "js_bool_neq_acml_bool", (function (param) { - return { - TAG: "Eq", - _0: true, - _1: true === true - }; - }) + return { + TAG: "Eq", + _0: true, + _1: true === true + }; + }) ], tl: /* [] */0 } diff --git a/jscomp/test/js_cast_test.js b/jscomp/test/js_cast_test.js index 0381b7f2a3..fd989e1ecd 100644 --- a/jscomp/test/js_cast_test.js +++ b/jscomp/test/js_cast_test.js @@ -25,12 +25,12 @@ function add_test(loc, test) { function eq(loc, x, y) { add_test(loc, (function (param) { - return { - TAG: "Eq", - _0: x, - _1: y - }; - })); + return { + TAG: "Eq", + _0: x, + _1: y + }; + })); } eq("File \"js_cast_test.res\", line 14, characters 12-19", true, 1); diff --git a/jscomp/test/js_date_test.js b/jscomp/test/js_date_test.js index c706003c87..d64282c5cb 100644 --- a/jscomp/test/js_date_test.js +++ b/jscomp/test/js_date_test.js @@ -11,142 +11,166 @@ function date(param) { var suites_0 = [ "valueOf", (function (param) { - return { - TAG: "Eq", - _0: 195131516789, - _1: new Date("1976-03-08T12:34:56.789+01:23").valueOf() - }; - }) + return { + TAG: "Eq", + _0: 195131516789, + _1: new Date("1976-03-08T12:34:56.789+01:23").valueOf() + }; + }) ]; var suites_1 = { hd: [ "make", (function (param) { - return { - TAG: "Ok", - _0: new Date().getTime() > 1487223505382 - }; - }) + return { + TAG: "Ok", + _0: new Date().getTime() > 1487223505382 + }; + }) ], tl: { hd: [ "parseAsFloat", (function (param) { - return { - TAG: "Eq", - _0: Date.parse("1976-03-08T12:34:56.789+01:23"), - _1: 195131516789 - }; - }) + return { + TAG: "Eq", + _0: Date.parse("1976-03-08T12:34:56.789+01:23"), + _1: 195131516789 + }; + }) ], tl: { hd: [ "parseAsFloat_invalid", (function (param) { - return { - TAG: "Ok", - _0: Number.isNaN(Date.parse("gibberish")) - }; - }) + return { + TAG: "Ok", + _0: Number.isNaN(Date.parse("gibberish")) + }; + }) ], tl: { hd: [ "fromFloat", (function (param) { - return { - TAG: "Eq", - _0: "1976-03-08T11:11:56.789Z", - _1: new Date(195131516789).toISOString() - }; - }) + return { + TAG: "Eq", + _0: "1976-03-08T11:11:56.789Z", + _1: new Date(195131516789).toISOString() + }; + }) ], tl: { hd: [ "fromString_valid", (function (param) { - return { - TAG: "Eq", - _0: 195131516789, - _1: new Date("1976-03-08T12:34:56.789+01:23").getTime() - }; - }) + return { + TAG: "Eq", + _0: 195131516789, + _1: new Date("1976-03-08T12:34:56.789+01:23").getTime() + }; + }) ], tl: { hd: [ "fromString_invalid", (function (param) { - return { - TAG: "Ok", - _0: Number.isNaN(new Date("gibberish").getTime()) - }; - }) + return { + TAG: "Ok", + _0: Number.isNaN(new Date("gibberish").getTime()) + }; + }) ], tl: { hd: [ "makeWithYM", (function (param) { - var d = new Date(1984, 4); + var d = new Date(1984, 4); + return { + TAG: "Eq", + _0: [ + 1984, + 4 + ], + _1: [ + d.getFullYear(), + d.getMonth() + ] + }; + }) + ], + tl: { + hd: [ + "makeWithYMD", + (function (param) { + var d = new Date(1984, 4, 6); return { TAG: "Eq", _0: [ 1984, - 4 + 4, + 6 ], _1: [ d.getFullYear(), - d.getMonth() + d.getMonth(), + d.getDate() ] }; }) - ], - tl: { - hd: [ - "makeWithYMD", - (function (param) { - var d = new Date(1984, 4, 6); + ], + tl: { + hd: [ + "makeWithYMDH", + (function (param) { + var d = new Date(1984, 4, 6, 3); return { TAG: "Eq", _0: [ 1984, 4, - 6 + 6, + 3 ], _1: [ d.getFullYear(), d.getMonth(), - d.getDate() + d.getDate(), + d.getHours() ] }; }) - ], - tl: { - hd: [ - "makeWithYMDH", - (function (param) { - var d = new Date(1984, 4, 6, 3); + ], + tl: { + hd: [ + "makeWithYMDHM", + (function (param) { + var d = new Date(1984, 4, 6, 3, 59); return { TAG: "Eq", _0: [ 1984, 4, 6, - 3 + 3, + 59 ], _1: [ d.getFullYear(), d.getMonth(), d.getDate(), - d.getHours() + d.getHours(), + d.getMinutes() ] }; }) - ], - tl: { - hd: [ - "makeWithYMDHM", - (function (param) { - var d = new Date(1984, 4, 6, 3, 59); + ], + tl: { + hd: [ + "makeWithYMDHMS", + (function (param) { + var d = new Date(1984, 4, 6, 3, 59, 27); return { TAG: "Eq", _0: [ @@ -154,89 +178,88 @@ var suites_1 = { 4, 6, 3, - 59 + 59, + 27 ], _1: [ d.getFullYear(), d.getMonth(), d.getDate(), d.getHours(), - d.getMinutes() + d.getMinutes(), + d.getSeconds() ] }; }) - ], - tl: { - hd: [ - "makeWithYMDHMS", - (function (param) { - var d = new Date(1984, 4, 6, 3, 59, 27); + ], + tl: { + hd: [ + "utcWithYM", + (function (param) { + var d = Date.UTC(1984, 4); + var d$1 = new Date(d); return { TAG: "Eq", _0: [ 1984, - 4, - 6, - 3, - 59, - 27 + 4 ], _1: [ - d.getFullYear(), - d.getMonth(), - d.getDate(), - d.getHours(), - d.getMinutes(), - d.getSeconds() + d$1.getUTCFullYear(), + d$1.getUTCMonth() ] }; }) - ], - tl: { - hd: [ - "utcWithYM", - (function (param) { - var d = Date.UTC(1984, 4); + ], + tl: { + hd: [ + "utcWithYMD", + (function (param) { + var d = Date.UTC(1984, 4, 6); var d$1 = new Date(d); return { TAG: "Eq", _0: [ 1984, - 4 + 4, + 6 ], _1: [ d$1.getUTCFullYear(), - d$1.getUTCMonth() + d$1.getUTCMonth(), + d$1.getUTCDate() ] }; }) - ], - tl: { - hd: [ - "utcWithYMD", - (function (param) { - var d = Date.UTC(1984, 4, 6); + ], + tl: { + hd: [ + "utcWithYMDH", + (function (param) { + var d = Date.UTC(1984, 4, 6, 3); var d$1 = new Date(d); return { TAG: "Eq", _0: [ 1984, 4, - 6 + 6, + 3 ], _1: [ d$1.getUTCFullYear(), d$1.getUTCMonth(), - d$1.getUTCDate() + d$1.getUTCDate(), + d$1.getUTCHours() ] }; }) - ], - tl: { - hd: [ - "utcWithYMDH", - (function (param) { - var d = Date.UTC(1984, 4, 6, 3); + ], + tl: { + hd: [ + "utcWithYMDHM", + (function (param) { + var d = Date.UTC(1984, 4, 6, 3, 59); var d$1 = new Date(d); return { TAG: "Eq", @@ -244,22 +267,24 @@ var suites_1 = { 1984, 4, 6, - 3 + 3, + 59 ], _1: [ d$1.getUTCFullYear(), d$1.getUTCMonth(), d$1.getUTCDate(), - d$1.getUTCHours() + d$1.getUTCHours(), + d$1.getUTCMinutes() ] }; }) - ], - tl: { - hd: [ - "utcWithYMDHM", - (function (param) { - var d = Date.UTC(1984, 4, 6, 3, 59); + ], + tl: { + hd: [ + "utcWithYMDHMS", + (function (param) { + var d = Date.UTC(1984, 4, 6, 3, 59, 27); var d$1 = new Date(d); return { TAG: "Eq", @@ -268,764 +293,739 @@ var suites_1 = { 4, 6, 3, - 59 + 59, + 27 ], _1: [ d$1.getUTCFullYear(), d$1.getUTCMonth(), d$1.getUTCDate(), d$1.getUTCHours(), - d$1.getUTCMinutes() + d$1.getUTCMinutes(), + d$1.getUTCSeconds() ] }; }) - ], - tl: { - hd: [ - "utcWithYMDHMS", - (function (param) { - var d = Date.UTC(1984, 4, 6, 3, 59, 27); - var d$1 = new Date(d); - return { - TAG: "Eq", - _0: [ - 1984, - 4, - 6, - 3, - 59, - 27 - ], - _1: [ - d$1.getUTCFullYear(), - d$1.getUTCMonth(), - d$1.getUTCDate(), - d$1.getUTCHours(), - d$1.getUTCMinutes(), - d$1.getUTCSeconds() - ] - }; - }) ], tl: { hd: [ "getFullYear", (function (param) { - return { - TAG: "Eq", - _0: 1976, - _1: new Date("1976-03-08T12:34:56.789+01:23").getFullYear() - }; - }) + return { + TAG: "Eq", + _0: 1976, + _1: new Date("1976-03-08T12:34:56.789+01:23").getFullYear() + }; + }) ], tl: { hd: [ "getMilliseconds", (function (param) { - return { - TAG: "Eq", - _0: 789, - _1: new Date("1976-03-08T12:34:56.789+01:23").getMilliseconds() - }; - }) + return { + TAG: "Eq", + _0: 789, + _1: new Date("1976-03-08T12:34:56.789+01:23").getMilliseconds() + }; + }) ], tl: { hd: [ "getSeconds", (function (param) { - return { - TAG: "Eq", - _0: 56, - _1: new Date("1976-03-08T12:34:56.789+01:23").getSeconds() - }; - }) + return { + TAG: "Eq", + _0: 56, + _1: new Date("1976-03-08T12:34:56.789+01:23").getSeconds() + }; + }) ], tl: { hd: [ "getTime", (function (param) { - return { - TAG: "Eq", - _0: 195131516789, - _1: new Date("1976-03-08T12:34:56.789+01:23").getTime() - }; - }) + return { + TAG: "Eq", + _0: 195131516789, + _1: new Date("1976-03-08T12:34:56.789+01:23").getTime() + }; + }) ], tl: { hd: [ "getUTCDate", (function (param) { - return { - TAG: "Eq", - _0: 8, - _1: new Date("1976-03-08T12:34:56.789+01:23").getUTCDate() - }; - }) + return { + TAG: "Eq", + _0: 8, + _1: new Date("1976-03-08T12:34:56.789+01:23").getUTCDate() + }; + }) ], tl: { hd: [ "getUTCDay", (function (param) { - return { - TAG: "Eq", - _0: 1, - _1: new Date("1976-03-08T12:34:56.789+01:23").getUTCDay() - }; - }) + return { + TAG: "Eq", + _0: 1, + _1: new Date("1976-03-08T12:34:56.789+01:23").getUTCDay() + }; + }) ], tl: { hd: [ "getUTCFUllYear", (function (param) { - return { - TAG: "Eq", - _0: 1976, - _1: new Date("1976-03-08T12:34:56.789+01:23").getUTCFullYear() - }; - }) + return { + TAG: "Eq", + _0: 1976, + _1: new Date("1976-03-08T12:34:56.789+01:23").getUTCFullYear() + }; + }) ], tl: { hd: [ "getUTCHours", (function (param) { - return { - TAG: "Eq", - _0: 11, - _1: new Date("1976-03-08T12:34:56.789+01:23").getUTCHours() - }; - }) + return { + TAG: "Eq", + _0: 11, + _1: new Date("1976-03-08T12:34:56.789+01:23").getUTCHours() + }; + }) ], tl: { hd: [ "getUTCMilliseconds", (function (param) { - return { - TAG: "Eq", - _0: 789, - _1: new Date("1976-03-08T12:34:56.789+01:23").getUTCMilliseconds() - }; - }) + return { + TAG: "Eq", + _0: 789, + _1: new Date("1976-03-08T12:34:56.789+01:23").getUTCMilliseconds() + }; + }) ], tl: { hd: [ "getUTCMinutes", (function (param) { - return { - TAG: "Eq", - _0: 11, - _1: new Date("1976-03-08T12:34:56.789+01:23").getUTCMinutes() - }; - }) + return { + TAG: "Eq", + _0: 11, + _1: new Date("1976-03-08T12:34:56.789+01:23").getUTCMinutes() + }; + }) ], tl: { hd: [ "getUTCMonth", (function (param) { - return { - TAG: "Eq", - _0: 2, - _1: new Date("1976-03-08T12:34:56.789+01:23").getUTCMonth() - }; - }) + return { + TAG: "Eq", + _0: 2, + _1: new Date("1976-03-08T12:34:56.789+01:23").getUTCMonth() + }; + }) ], tl: { hd: [ "getUTCSeconds", (function (param) { - return { - TAG: "Eq", - _0: 56, - _1: new Date("1976-03-08T12:34:56.789+01:23").getUTCSeconds() - }; - }) + return { + TAG: "Eq", + _0: 56, + _1: new Date("1976-03-08T12:34:56.789+01:23").getUTCSeconds() + }; + }) ], tl: { hd: [ "getYear", (function (param) { - return { - TAG: "Eq", - _0: 1976, - _1: new Date("1976-03-08T12:34:56.789+01:23").getFullYear() - }; - }) + return { + TAG: "Eq", + _0: 1976, + _1: new Date("1976-03-08T12:34:56.789+01:23").getFullYear() + }; + }) ], tl: { hd: [ "setDate", (function (param) { - var d = new Date("1976-03-08T12:34:56.789+01:23"); - d.setDate(12); - return { - TAG: "Eq", - _0: 12, - _1: d.getDate() - }; - }) + var d = new Date("1976-03-08T12:34:56.789+01:23"); + d.setDate(12); + return { + TAG: "Eq", + _0: 12, + _1: d.getDate() + }; + }) ], tl: { hd: [ "setFullYear", (function (param) { - var d = new Date("1976-03-08T12:34:56.789+01:23"); - d.setFullYear(1986); - return { - TAG: "Eq", - _0: 1986, - _1: d.getFullYear() - }; - }) + var d = new Date("1976-03-08T12:34:56.789+01:23"); + d.setFullYear(1986); + return { + TAG: "Eq", + _0: 1986, + _1: d.getFullYear() + }; + }) ], tl: { hd: [ "setFullYearM", (function (param) { + var d = new Date("1976-03-08T12:34:56.789+01:23"); + d.setFullYear(1986, 7); + return { + TAG: "Eq", + _0: [ + 1986, + 7 + ], + _1: [ + d.getFullYear(), + d.getMonth() + ] + }; + }) + ], + tl: { + hd: [ + "setFullYearMD", + (function (param) { var d = new Date("1976-03-08T12:34:56.789+01:23"); - d.setFullYear(1986, 7); + d.setFullYear(1986, 7, 23); return { TAG: "Eq", _0: [ 1986, - 7 + 7, + 23 ], _1: [ d.getFullYear(), - d.getMonth() + d.getMonth(), + d.getDate() ] }; }) - ], - tl: { - hd: [ - "setFullYearMD", - (function (param) { - var d = new Date("1976-03-08T12:34:56.789+01:23"); - d.setFullYear(1986, 7, 23); - return { - TAG: "Eq", - _0: [ - 1986, - 7, - 23 - ], - _1: [ - d.getFullYear(), - d.getMonth(), - d.getDate() - ] - }; - }) ], tl: { hd: [ "setHours", (function (param) { - var d = new Date("1976-03-08T12:34:56.789+01:23"); - d.setHours(22); - return { - TAG: "Eq", - _0: 22, - _1: d.getHours() - }; - }) + var d = new Date("1976-03-08T12:34:56.789+01:23"); + d.setHours(22); + return { + TAG: "Eq", + _0: 22, + _1: d.getHours() + }; + }) ], tl: { hd: [ "setHoursM", (function (param) { + var d = new Date("1976-03-08T12:34:56.789+01:23"); + d.setHours(22, 48); + return { + TAG: "Eq", + _0: [ + 22, + 48 + ], + _1: [ + d.getHours(), + d.getMinutes() + ] + }; + }) + ], + tl: { + hd: [ + "setHoursMS", + (function (param) { var d = new Date("1976-03-08T12:34:56.789+01:23"); - d.setHours(22, 48); + d.setHours(22, 48, 54); return { TAG: "Eq", _0: [ 22, - 48 + 48, + 54 ], _1: [ d.getHours(), - d.getMinutes() + d.getMinutes(), + d.getSeconds() ] }; }) - ], - tl: { - hd: [ - "setHoursMS", - (function (param) { - var d = new Date("1976-03-08T12:34:56.789+01:23"); - d.setHours(22, 48, 54); - return { - TAG: "Eq", - _0: [ - 22, - 48, - 54 - ], - _1: [ - d.getHours(), - d.getMinutes(), - d.getSeconds() - ] - }; - }) ], tl: { hd: [ "setMilliseconds", (function (param) { - var d = new Date("1976-03-08T12:34:56.789+01:23"); - d.setMilliseconds(543); - return { - TAG: "Eq", - _0: 543, - _1: d.getMilliseconds() - }; - }) + var d = new Date("1976-03-08T12:34:56.789+01:23"); + d.setMilliseconds(543); + return { + TAG: "Eq", + _0: 543, + _1: d.getMilliseconds() + }; + }) ], tl: { hd: [ "setMinutes", (function (param) { - var d = new Date("1976-03-08T12:34:56.789+01:23"); - d.setMinutes(18); - return { - TAG: "Eq", - _0: 18, - _1: d.getMinutes() - }; - }) + var d = new Date("1976-03-08T12:34:56.789+01:23"); + d.setMinutes(18); + return { + TAG: "Eq", + _0: 18, + _1: d.getMinutes() + }; + }) ], tl: { hd: [ "setMinutesS", (function (param) { + var d = new Date("1976-03-08T12:34:56.789+01:23"); + d.setMinutes(18, 42); + return { + TAG: "Eq", + _0: [ + 18, + 42 + ], + _1: [ + d.getMinutes(), + d.getSeconds() + ] + }; + }) + ], + tl: { + hd: [ + "setMinutesSMs", + (function (param) { var d = new Date("1976-03-08T12:34:56.789+01:23"); - d.setMinutes(18, 42); + d.setMinutes(18, 42, 311); return { TAG: "Eq", _0: [ 18, - 42 + 42, + 311 ], _1: [ d.getMinutes(), - d.getSeconds() + d.getSeconds(), + d.getMilliseconds() ] }; }) - ], - tl: { - hd: [ - "setMinutesSMs", - (function (param) { - var d = new Date("1976-03-08T12:34:56.789+01:23"); - d.setMinutes(18, 42, 311); - return { - TAG: "Eq", - _0: [ - 18, - 42, - 311 - ], - _1: [ - d.getMinutes(), - d.getSeconds(), - d.getMilliseconds() - ] - }; - }) ], tl: { hd: [ "setMonth", (function (param) { - var d = new Date("1976-03-08T12:34:56.789+01:23"); - d.setMonth(10); - return { - TAG: "Eq", - _0: 10, - _1: d.getMonth() - }; - }) + var d = new Date("1976-03-08T12:34:56.789+01:23"); + d.setMonth(10); + return { + TAG: "Eq", + _0: 10, + _1: d.getMonth() + }; + }) ], tl: { hd: [ "setMonthD", (function (param) { - var d = new Date("1976-03-08T12:34:56.789+01:23"); - d.setMonth(10, 14); - return { - TAG: "Eq", - _0: [ - 10, - 14 - ], - _1: [ - d.getMonth(), - d.getDate() - ] - }; - }) + var d = new Date("1976-03-08T12:34:56.789+01:23"); + d.setMonth(10, 14); + return { + TAG: "Eq", + _0: [ + 10, + 14 + ], + _1: [ + d.getMonth(), + d.getDate() + ] + }; + }) ], tl: { hd: [ "setSeconds", (function (param) { - var d = new Date("1976-03-08T12:34:56.789+01:23"); - d.setSeconds(36); - return { - TAG: "Eq", - _0: 36, - _1: d.getSeconds() - }; - }) + var d = new Date("1976-03-08T12:34:56.789+01:23"); + d.setSeconds(36); + return { + TAG: "Eq", + _0: 36, + _1: d.getSeconds() + }; + }) ], tl: { hd: [ "setSecondsMs", (function (param) { - var d = new Date("1976-03-08T12:34:56.789+01:23"); - d.setSeconds(36, 420); - return { - TAG: "Eq", - _0: [ - 36, - 420 - ], - _1: [ - d.getSeconds(), - d.getMilliseconds() - ] - }; - }) + var d = new Date("1976-03-08T12:34:56.789+01:23"); + d.setSeconds(36, 420); + return { + TAG: "Eq", + _0: [ + 36, + 420 + ], + _1: [ + d.getSeconds(), + d.getMilliseconds() + ] + }; + }) ], tl: { hd: [ "setUTCDate", (function (param) { - var d = new Date("1976-03-08T12:34:56.789+01:23"); - d.setUTCDate(12); - return { - TAG: "Eq", - _0: 12, - _1: d.getUTCDate() - }; - }) + var d = new Date("1976-03-08T12:34:56.789+01:23"); + d.setUTCDate(12); + return { + TAG: "Eq", + _0: 12, + _1: d.getUTCDate() + }; + }) ], tl: { hd: [ "setUTCFullYear", (function (param) { - var d = new Date("1976-03-08T12:34:56.789+01:23"); - d.setUTCFullYear(1986); - return { - TAG: "Eq", - _0: 1986, - _1: d.getUTCFullYear() - }; - }) + var d = new Date("1976-03-08T12:34:56.789+01:23"); + d.setUTCFullYear(1986); + return { + TAG: "Eq", + _0: 1986, + _1: d.getUTCFullYear() + }; + }) ], tl: { hd: [ "setUTCFullYearM", (function (param) { + var d = new Date("1976-03-08T12:34:56.789+01:23"); + d.setUTCFullYear(1986, 7); + return { + TAG: "Eq", + _0: [ + 1986, + 7 + ], + _1: [ + d.getUTCFullYear(), + d.getUTCMonth() + ] + }; + }) + ], + tl: { + hd: [ + "setUTCFullYearMD", + (function (param) { var d = new Date("1976-03-08T12:34:56.789+01:23"); - d.setUTCFullYear(1986, 7); + d.setUTCFullYear(1986, 7, 23); return { TAG: "Eq", _0: [ 1986, - 7 + 7, + 23 ], _1: [ d.getUTCFullYear(), - d.getUTCMonth() + d.getUTCMonth(), + d.getUTCDate() ] }; }) - ], - tl: { - hd: [ - "setUTCFullYearMD", - (function (param) { - var d = new Date("1976-03-08T12:34:56.789+01:23"); - d.setUTCFullYear(1986, 7, 23); - return { - TAG: "Eq", - _0: [ - 1986, - 7, - 23 - ], - _1: [ - d.getUTCFullYear(), - d.getUTCMonth(), - d.getUTCDate() - ] - }; - }) ], tl: { hd: [ "setUTCHours", (function (param) { - var d = new Date("1976-03-08T12:34:56.789+01:23"); - d.setUTCHours(22); - return { - TAG: "Eq", - _0: 22, - _1: d.getUTCHours() - }; - }) + var d = new Date("1976-03-08T12:34:56.789+01:23"); + d.setUTCHours(22); + return { + TAG: "Eq", + _0: 22, + _1: d.getUTCHours() + }; + }) ], tl: { hd: [ "setUTCHoursM", (function (param) { + var d = new Date("1976-03-08T12:34:56.789+01:23"); + d.setUTCHours(22, 48); + return { + TAG: "Eq", + _0: [ + 22, + 48 + ], + _1: [ + d.getUTCHours(), + d.getUTCMinutes() + ] + }; + }) + ], + tl: { + hd: [ + "setUTCHoursMS", + (function (param) { var d = new Date("1976-03-08T12:34:56.789+01:23"); - d.setUTCHours(22, 48); + d.setUTCHours(22, 48, 54); return { TAG: "Eq", _0: [ 22, - 48 + 48, + 54 ], _1: [ d.getUTCHours(), - d.getUTCMinutes() + d.getUTCMinutes(), + d.getUTCSeconds() ] }; }) - ], - tl: { - hd: [ - "setUTCHoursMS", - (function (param) { - var d = new Date("1976-03-08T12:34:56.789+01:23"); - d.setUTCHours(22, 48, 54); - return { - TAG: "Eq", - _0: [ - 22, - 48, - 54 - ], - _1: [ - d.getUTCHours(), - d.getUTCMinutes(), - d.getUTCSeconds() - ] - }; - }) ], tl: { hd: [ "setUTCMilliseconds", (function (param) { - var d = new Date("1976-03-08T12:34:56.789+01:23"); - d.setUTCMilliseconds(543); - return { - TAG: "Eq", - _0: 543, - _1: d.getUTCMilliseconds() - }; - }) + var d = new Date("1976-03-08T12:34:56.789+01:23"); + d.setUTCMilliseconds(543); + return { + TAG: "Eq", + _0: 543, + _1: d.getUTCMilliseconds() + }; + }) ], tl: { hd: [ "setUTCMinutes", (function (param) { - var d = new Date("1976-03-08T12:34:56.789+01:23"); - d.setUTCMinutes(18); - return { - TAG: "Eq", - _0: 18, - _1: d.getUTCMinutes() - }; - }) + var d = new Date("1976-03-08T12:34:56.789+01:23"); + d.setUTCMinutes(18); + return { + TAG: "Eq", + _0: 18, + _1: d.getUTCMinutes() + }; + }) ], tl: { hd: [ "setUTCMinutesS", (function (param) { + var d = new Date("1976-03-08T12:34:56.789+01:23"); + d.setUTCMinutes(18, 42); + return { + TAG: "Eq", + _0: [ + 18, + 42 + ], + _1: [ + d.getUTCMinutes(), + d.getUTCSeconds() + ] + }; + }) + ], + tl: { + hd: [ + "setUTCMinutesSMs", + (function (param) { var d = new Date("1976-03-08T12:34:56.789+01:23"); - d.setUTCMinutes(18, 42); + d.setUTCMinutes(18, 42, 311); return { TAG: "Eq", _0: [ 18, - 42 + 42, + 311 ], _1: [ d.getUTCMinutes(), - d.getUTCSeconds() + d.getUTCSeconds(), + d.getUTCMilliseconds() ] }; }) - ], - tl: { - hd: [ - "setUTCMinutesSMs", - (function (param) { - var d = new Date("1976-03-08T12:34:56.789+01:23"); - d.setUTCMinutes(18, 42, 311); - return { - TAG: "Eq", - _0: [ - 18, - 42, - 311 - ], - _1: [ - d.getUTCMinutes(), - d.getUTCSeconds(), - d.getUTCMilliseconds() - ] - }; - }) ], tl: { hd: [ "setUTCMonth", (function (param) { - var d = new Date("1976-03-08T12:34:56.789+01:23"); - d.setUTCMonth(10); - return { - TAG: "Eq", - _0: 10, - _1: d.getUTCMonth() - }; - }) + var d = new Date("1976-03-08T12:34:56.789+01:23"); + d.setUTCMonth(10); + return { + TAG: "Eq", + _0: 10, + _1: d.getUTCMonth() + }; + }) ], tl: { hd: [ "setUTCMonthD", (function (param) { - var d = new Date("1976-03-08T12:34:56.789+01:23"); - d.setUTCMonth(10, 14); - return { - TAG: "Eq", - _0: [ - 10, - 14 - ], - _1: [ - d.getUTCMonth(), - d.getUTCDate() - ] - }; - }) + var d = new Date("1976-03-08T12:34:56.789+01:23"); + d.setUTCMonth(10, 14); + return { + TAG: "Eq", + _0: [ + 10, + 14 + ], + _1: [ + d.getUTCMonth(), + d.getUTCDate() + ] + }; + }) ], tl: { hd: [ "setUTCSeconds", (function (param) { - var d = new Date("1976-03-08T12:34:56.789+01:23"); - d.setUTCSeconds(36); - return { - TAG: "Eq", - _0: 36, - _1: d.getUTCSeconds() - }; - }) + var d = new Date("1976-03-08T12:34:56.789+01:23"); + d.setUTCSeconds(36); + return { + TAG: "Eq", + _0: 36, + _1: d.getUTCSeconds() + }; + }) ], tl: { hd: [ "setUTCSecondsMs", (function (param) { - var d = new Date("1976-03-08T12:34:56.789+01:23"); - d.setUTCSeconds(36, 420); - return { - TAG: "Eq", - _0: [ - 36, - 420 - ], - _1: [ - d.getUTCSeconds(), - d.getUTCMilliseconds() - ] - }; - }) + var d = new Date("1976-03-08T12:34:56.789+01:23"); + d.setUTCSeconds(36, 420); + return { + TAG: "Eq", + _0: [ + 36, + 420 + ], + _1: [ + d.getUTCSeconds(), + d.getUTCMilliseconds() + ] + }; + }) ], tl: { hd: [ "toDateString", (function (param) { - return { - TAG: "Eq", - _0: "Mon Mar 08 1976", - _1: new Date("1976-03-08T12:34:56.789+01:23").toDateString() - }; - }) + return { + TAG: "Eq", + _0: "Mon Mar 08 1976", + _1: new Date("1976-03-08T12:34:56.789+01:23").toDateString() + }; + }) ], tl: { hd: [ "toGMTString", (function (param) { - return { - TAG: "Eq", - _0: "Mon, 08 Mar 1976 11:11:56 GMT", - _1: new Date("1976-03-08T12:34:56.789+01:23").toUTCString() - }; - }) + return { + TAG: "Eq", + _0: "Mon, 08 Mar 1976 11:11:56 GMT", + _1: new Date("1976-03-08T12:34:56.789+01:23").toUTCString() + }; + }) ], tl: { hd: [ "toISOString", (function (param) { - return { - TAG: "Eq", - _0: "1976-03-08T11:11:56.789Z", - _1: new Date("1976-03-08T12:34:56.789+01:23").toISOString() - }; - }) + return { + TAG: "Eq", + _0: "1976-03-08T11:11:56.789Z", + _1: new Date("1976-03-08T12:34:56.789+01:23").toISOString() + }; + }) ], tl: { hd: [ "toJSON", (function (param) { + return { + TAG: "Eq", + _0: "1976-03-08T11:11:56.789Z", + _1: new Date("1976-03-08T12:34:56.789+01:23").toJSON() + }; + }) + ], + tl: { + hd: [ + "toJSONUnsafe", + (function (param) { return { TAG: "Eq", _0: "1976-03-08T11:11:56.789Z", _1: new Date("1976-03-08T12:34:56.789+01:23").toJSON() }; }) - ], - tl: { - hd: [ - "toJSONUnsafe", - (function (param) { - return { - TAG: "Eq", - _0: "1976-03-08T11:11:56.789Z", - _1: new Date("1976-03-08T12:34:56.789+01:23").toJSON() - }; - }) ], tl: { hd: [ "toUTCString", (function (param) { - return { - TAG: "Eq", - _0: "Mon, 08 Mar 1976 11:11:56 GMT", - _1: new Date("1976-03-08T12:34:56.789+01:23").toUTCString() - }; - }) + return { + TAG: "Eq", + _0: "Mon, 08 Mar 1976 11:11:56 GMT", + _1: new Date("1976-03-08T12:34:56.789+01:23").toUTCString() + }; + }) ], tl: { hd: [ "eq", (function (param) { - var a = new Date("2013-03-01T01:10:00"); - var b = new Date("2013-03-01T01:10:00"); - var c = new Date("2013-03-01T01:10:01"); - return { - TAG: "Ok", - _0: Caml_obj.equal(a, b) && Caml_obj.notequal(b, c) && Caml_obj.greaterthan(c, b) - }; - }) + var a = new Date("2013-03-01T01:10:00"); + var b = new Date("2013-03-01T01:10:00"); + var c = new Date("2013-03-01T01:10:01"); + return { + TAG: "Ok", + _0: Caml_obj.equal(a, b) && Caml_obj.notequal(b, c) && Caml_obj.greaterthan(c, b) + }; + }) ], tl: /* [] */0 } diff --git a/jscomp/test/js_dict_test.js b/jscomp/test/js_dict_test.js index 0453098f94..a09304d2a0 100644 --- a/jscomp/test/js_dict_test.js +++ b/jscomp/test/js_dict_test.js @@ -14,230 +14,230 @@ function obj(param) { var suites_0 = [ "empty", (function (param) { - return { - TAG: "Eq", - _0: [], - _1: Object.keys({}) - }; - }) + return { + TAG: "Eq", + _0: [], + _1: Object.keys({}) + }; + }) ]; var suites_1 = { hd: [ "get", (function (param) { - return { - TAG: "Eq", - _0: 43, - _1: Js_dict.get({ - foo: 43, - bar: 86 - }, "foo") - }; - }) + return { + TAG: "Eq", + _0: 43, + _1: Js_dict.get({ + foo: 43, + bar: 86 + }, "foo") + }; + }) ], tl: { hd: [ "get - property not in object", (function (param) { - return { - TAG: "Eq", - _0: undefined, - _1: Js_dict.get({ - foo: 43, - bar: 86 - }, "baz") - }; - }) + return { + TAG: "Eq", + _0: undefined, + _1: Js_dict.get({ + foo: 43, + bar: 86 + }, "baz") + }; + }) ], tl: { hd: [ "unsafe_get", (function (param) { - return { - TAG: "Eq", - _0: 43, - _1: ({ - foo: 43, - bar: 86 - })["foo"] - }; - }) + return { + TAG: "Eq", + _0: 43, + _1: ({ + foo: 43, + bar: 86 + })["foo"] + }; + }) ], tl: { hd: [ "set", (function (param) { - var o = { - foo: 43, - bar: 86 - }; - o["foo"] = 36; - return { - TAG: "Eq", - _0: 36, - _1: Js_dict.get(o, "foo") - }; - }) + var o = { + foo: 43, + bar: 86 + }; + o["foo"] = 36; + return { + TAG: "Eq", + _0: 36, + _1: Js_dict.get(o, "foo") + }; + }) ], tl: { hd: [ "keys", (function (param) { + return { + TAG: "Eq", + _0: [ + "foo", + "bar" + ], + _1: Object.keys({ + foo: 43, + bar: 86 + }) + }; + }) + ], + tl: { + hd: [ + "entries", + (function (param) { return { TAG: "Eq", _0: [ - "foo", - "bar" + [ + "foo", + 43 + ], + [ + "bar", + 86 + ] ], - _1: Object.keys({ - foo: 43, - bar: 86 - }) + _1: Js_dict.entries({ + foo: 43, + bar: 86 + }) }; }) - ], - tl: { - hd: [ - "entries", - (function (param) { + ], + tl: { + hd: [ + "values", + (function (param) { return { TAG: "Eq", _0: [ - [ - "foo", - 43 - ], - [ - "bar", - 86 - ] + 43, + 86 ], - _1: Js_dict.entries({ - foo: 43, - bar: 86 - }) + _1: Js_dict.values({ + foo: 43, + bar: 86 + }) }; }) - ], - tl: { - hd: [ - "values", - (function (param) { - return { - TAG: "Eq", - _0: [ - 43, - 86 - ], - _1: Js_dict.values({ - foo: 43, - bar: 86 - }) - }; - }) ], tl: { hd: [ "fromList - []", (function (param) { - return { - TAG: "Eq", - _0: {}, - _1: Js_dict.fromList(/* [] */0) - }; - }) + return { + TAG: "Eq", + _0: {}, + _1: Js_dict.fromList(/* [] */0) + }; + }) ], tl: { hd: [ "fromList", (function (param) { - return { - TAG: "Eq", - _0: [ - [ - "x", - 23 - ], - [ + return { + TAG: "Eq", + _0: [ + [ + "x", + 23 + ], + [ + "y", + 46 + ] + ], + _1: Js_dict.entries(Js_dict.fromList({ + hd: [ + "x", + 23 + ], + tl: { + hd: [ "y", 46 - ] - ], - _1: Js_dict.entries(Js_dict.fromList({ - hd: [ - "x", - 23 - ], - tl: { - hd: [ - "y", - 46 - ], - tl: /* [] */0 - } - })) - }; - }) + ], + tl: /* [] */0 + } + })) + }; + }) ], tl: { hd: [ "fromArray - []", (function (param) { - return { - TAG: "Eq", - _0: {}, - _1: Js_dict.fromArray([]) - }; - }) + return { + TAG: "Eq", + _0: {}, + _1: Js_dict.fromArray([]) + }; + }) ], tl: { hd: [ "fromArray", (function (param) { - return { - TAG: "Eq", - _0: [ - [ - "x", - 23 - ], - [ - "y", - 46 - ] + return { + TAG: "Eq", + _0: [ + [ + "x", + 23 ], - _1: Js_dict.entries(Js_dict.fromArray([ - [ - "x", - 23 - ], - [ - "y", - 46 - ] - ])) - }; - }) + [ + "y", + 46 + ] + ], + _1: Js_dict.entries(Js_dict.fromArray([ + [ + "x", + 23 + ], + [ + "y", + 46 + ] + ])) + }; + }) ], tl: { hd: [ "map", (function (param) { - return { - TAG: "Eq", - _0: { - foo: "43", - bar: "86" - }, - _1: Js_dict.map((function (i) { - return String(i); - }), { - foo: 43, - bar: 86 - }) - }; - }) + return { + TAG: "Eq", + _0: { + foo: "43", + bar: "86" + }, + _1: Js_dict.map((function (i) { + return String(i); + }), { + foo: 43, + bar: 86 + }) + }; + }) ], tl: /* [] */0 } diff --git a/jscomp/test/js_exception_catch_test.js b/jscomp/test/js_exception_catch_test.js index 2bdeabb767..e3c2d95b62 100644 --- a/jscomp/test/js_exception_catch_test.js +++ b/jscomp/test/js_exception_catch_test.js @@ -29,30 +29,30 @@ function add_test(loc, test) { function eq(loc, x, y) { add_test(loc, (function (param) { - return { - TAG: "Eq", - _0: x, - _1: y - }; - })); + return { + TAG: "Eq", + _0: x, + _1: y + }; + })); } function false_(loc) { add_test(loc, (function (param) { - return { - TAG: "Ok", - _0: false - }; - })); + return { + TAG: "Ok", + _0: false + }; + })); } function true_(loc) { add_test(loc, (function (param) { - return { - TAG: "Ok", - _0: true - }; - })); + return { + TAG: "Ok", + _0: true + }; + })); } var exit = 0; @@ -67,11 +67,11 @@ catch (raw_x){ var x = Caml_js_exceptions.internalToOCamlException(raw_x); if (x.RE_EXN_ID === Js_exn.$$Error) { add_test("File \"js_exception_catch_test.res\", line 18, characters 37-44", (function (param) { - return { - TAG: "Ok", - _0: true - }; - })); + return { + TAG: "Ok", + _0: true + }; + })); } else { throw x; } @@ -79,11 +79,11 @@ catch (raw_x){ if (exit === 1) { add_test("File \"js_exception_catch_test.res\", line 19, characters 14-21", (function (param) { - return { - TAG: "Ok", - _0: false - }; - })); + return { + TAG: "Ok", + _0: false + }; + })); } var A = /* @__PURE__ */Caml_exceptions.create("Js_exception_catch_test.A"); @@ -130,84 +130,84 @@ function test(f) { } eq("File \"js_exception_catch_test.res\", line 44, characters 5-12", test(function (param) { - - }), "No_error"); + +}), "No_error"); eq("File \"js_exception_catch_test.res\", line 45, characters 5-12", test(function (param) { - throw { - RE_EXN_ID: "Not_found", - Error: new Error() - }; - }), "Not_found"); + throw { + RE_EXN_ID: "Not_found", + Error: new Error() + }; +}), "Not_found"); eq("File \"js_exception_catch_test.res\", line 46, characters 5-12", test(function (param) { - throw { - RE_EXN_ID: "Invalid_argument", - _1: "x", - Error: new Error() - }; - }), "Invalid_argument"); + throw { + RE_EXN_ID: "Invalid_argument", + _1: "x", + Error: new Error() + }; +}), "Invalid_argument"); eq("File \"js_exception_catch_test.res\", line 47, characters 5-12", test(function (param) { - throw { - RE_EXN_ID: "Invalid_argument", - _1: "", - Error: new Error() - }; - }), "Invalid_any"); + throw { + RE_EXN_ID: "Invalid_argument", + _1: "", + Error: new Error() + }; +}), "Invalid_any"); eq("File \"js_exception_catch_test.res\", line 48, characters 5-12", test(function (param) { - throw { - RE_EXN_ID: A, - _1: 2, - Error: new Error() - }; - }), "A2"); + throw { + RE_EXN_ID: A, + _1: 2, + Error: new Error() + }; +}), "A2"); eq("File \"js_exception_catch_test.res\", line 49, characters 5-12", test(function (param) { - throw { - RE_EXN_ID: A, - _1: 3, - Error: new Error() - }; - }), "A_any"); + throw { + RE_EXN_ID: A, + _1: 3, + Error: new Error() + }; +}), "A_any"); eq("File \"js_exception_catch_test.res\", line 50, characters 5-12", test(function (param) { - throw { - RE_EXN_ID: B, - Error: new Error() - }; - }), "B"); + throw { + RE_EXN_ID: B, + Error: new Error() + }; +}), "B"); eq("File \"js_exception_catch_test.res\", line 51, characters 5-12", test(function (param) { - throw { - RE_EXN_ID: C, - _1: 1, - _2: 2, - Error: new Error() - }; - }), "C"); + throw { + RE_EXN_ID: C, + _1: 1, + _2: 2, + Error: new Error() + }; +}), "C"); eq("File \"js_exception_catch_test.res\", line 52, characters 5-12", test(function (param) { - throw { - RE_EXN_ID: C, - _1: 0, - _2: 2, - Error: new Error() - }; - }), "C_any"); + throw { + RE_EXN_ID: C, + _1: 0, + _2: 2, + Error: new Error() + }; +}), "C_any"); eq("File \"js_exception_catch_test.res\", line 53, characters 5-12", test(function (param) { - throw new Error("x"); - }), "Js_error"); + throw new Error("x"); +}), "Js_error"); eq("File \"js_exception_catch_test.res\", line 54, characters 5-12", test(function (param) { - throw { - RE_EXN_ID: "Failure", - _1: "x", - Error: new Error() - }; - }), "Any"); + throw { + RE_EXN_ID: "Failure", + _1: "x", + Error: new Error() + }; +}), "Any"); Mt.from_pair_suites("Js_exception_catch_test", suites.contents); diff --git a/jscomp/test/js_float_test.js b/jscomp/test/js_float_test.js index 2971a30702..fcf55631bd 100644 --- a/jscomp/test/js_float_test.js +++ b/jscomp/test/js_float_test.js @@ -7,484 +7,484 @@ var Pervasives = require("../../lib/js/pervasives.js"); var suites_0 = [ "_NaN <> _NaN", (function (param) { - return { - TAG: "Eq", - _0: false, - _1: NaN === NaN - }; - }) + return { + TAG: "Eq", + _0: false, + _1: NaN === NaN + }; + }) ]; var suites_1 = { hd: [ "isNaN - _NaN", (function (param) { - return { - TAG: "Eq", - _0: true, - _1: Number.isNaN(NaN) - }; - }) + return { + TAG: "Eq", + _0: true, + _1: Number.isNaN(NaN) + }; + }) ], tl: { hd: [ "isNaN - 0.", (function (param) { - return { - TAG: "Eq", - _0: false, - _1: Number.isNaN(0) - }; - }) + return { + TAG: "Eq", + _0: false, + _1: Number.isNaN(0) + }; + }) ], tl: { hd: [ "isFinite - infinity", (function (param) { - return { - TAG: "Eq", - _0: false, - _1: Number.isFinite(Pervasives.infinity) - }; - }) + return { + TAG: "Eq", + _0: false, + _1: Number.isFinite(Pervasives.infinity) + }; + }) ], tl: { hd: [ "isFinite - neg_infinity", (function (param) { - return { - TAG: "Eq", - _0: false, - _1: Number.isFinite(Pervasives.neg_infinity) - }; - }) + return { + TAG: "Eq", + _0: false, + _1: Number.isFinite(Pervasives.neg_infinity) + }; + }) ], tl: { hd: [ "isFinite - _NaN", (function (param) { - return { - TAG: "Eq", - _0: false, - _1: Number.isFinite(NaN) - }; - }) + return { + TAG: "Eq", + _0: false, + _1: Number.isFinite(NaN) + }; + }) ], tl: { hd: [ "isFinite - 0.", (function (param) { - return { - TAG: "Eq", - _0: true, - _1: Number.isFinite(0) - }; - }) + return { + TAG: "Eq", + _0: true, + _1: Number.isFinite(0) + }; + }) ], tl: { hd: [ "toExponential", (function (param) { - return { - TAG: "Eq", - _0: "1.23456e+2", - _1: (123.456).toExponential() - }; - }) + return { + TAG: "Eq", + _0: "1.23456e+2", + _1: (123.456).toExponential() + }; + }) ], tl: { hd: [ "toExponential - large number", (function (param) { - return { - TAG: "Eq", - _0: "1.2e+21", - _1: (1.2e21).toExponential() - }; - }) + return { + TAG: "Eq", + _0: "1.2e+21", + _1: (1.2e21).toExponential() + }; + }) ], tl: { hd: [ "toExponentialWithPrecision - digits:2", (function (param) { - return { - TAG: "Eq", - _0: "1.23e+2", - _1: (123.456).toExponential(2) - }; - }) + return { + TAG: "Eq", + _0: "1.23e+2", + _1: (123.456).toExponential(2) + }; + }) ], tl: { hd: [ "toExponentialWithPrecision - digits:4", (function (param) { - return { - TAG: "Eq", - _0: "1.2346e+2", - _1: (123.456).toExponential(4) - }; - }) + return { + TAG: "Eq", + _0: "1.2346e+2", + _1: (123.456).toExponential(4) + }; + }) ], tl: { hd: [ "toExponentialWithPrecision - digits:20", (function (param) { - return { - TAG: "Eq", - _0: "0.00000000000000000000e+0", - _1: (0).toExponential(20) - }; - }) + return { + TAG: "Eq", + _0: "0.00000000000000000000e+0", + _1: (0).toExponential(20) + }; + }) ], tl: { hd: [ "File \"js_float_test.res\", line 27, characters 5-12", (function (param) { - return { - TAG: "ThrowAny", - _0: (function (param) { - (0).toExponential(101); - }) - }; - }) + return { + TAG: "ThrowAny", + _0: (function (param) { + (0).toExponential(101); + }) + }; + }) ], tl: { hd: [ "toExponentialWithPrecision - digits:-1", (function (param) { - return { - TAG: "ThrowAny", - _0: (function (param) { - (0).toExponential(-1); - }) - }; - }) + return { + TAG: "ThrowAny", + _0: (function (param) { + (0).toExponential(-1); + }) + }; + }) ], tl: { hd: [ "toFixed", (function (param) { - return { - TAG: "Eq", - _0: "123", - _1: (123.456).toFixed() - }; - }) + return { + TAG: "Eq", + _0: "123", + _1: (123.456).toFixed() + }; + }) ], tl: { hd: [ "toFixed - large number", (function (param) { - return { - TAG: "Eq", - _0: "1.2e+21", - _1: (1.2e21).toFixed() - }; - }) + return { + TAG: "Eq", + _0: "1.2e+21", + _1: (1.2e21).toFixed() + }; + }) ], tl: { hd: [ "toFixedWithPrecision - digits:2", (function (param) { - return { - TAG: "Eq", - _0: "123.46", - _1: (123.456).toFixed(2) - }; - }) + return { + TAG: "Eq", + _0: "123.46", + _1: (123.456).toFixed(2) + }; + }) ], tl: { hd: [ "toFixedWithPrecision - digits:4", (function (param) { - return { - TAG: "Eq", - _0: "123.4560", - _1: (123.456).toFixed(4) - }; - }) + return { + TAG: "Eq", + _0: "123.4560", + _1: (123.456).toFixed(4) + }; + }) ], tl: { hd: [ "toFixedWithPrecision - digits:20", (function (param) { - return { - TAG: "Eq", - _0: "0.00000000000000000000", - _1: (0).toFixed(20) - }; - }) + return { + TAG: "Eq", + _0: "0.00000000000000000000", + _1: (0).toFixed(20) + }; + }) ], tl: { hd: [ "toFixedWithPrecision - digits:101", (function (param) { - return { - TAG: "ThrowAny", - _0: (function (param) { - (0).toFixed(101); - }) - }; - }) + return { + TAG: "ThrowAny", + _0: (function (param) { + (0).toFixed(101); + }) + }; + }) ], tl: { hd: [ "toFixedWithPrecision - digits:-1", (function (param) { - return { - TAG: "ThrowAny", - _0: (function (param) { - (0).toFixed(-1); - }) - }; - }) + return { + TAG: "ThrowAny", + _0: (function (param) { + (0).toFixed(-1); + }) + }; + }) ], tl: { hd: [ "toPrecision", (function (param) { - return { - TAG: "Eq", - _0: "123.456", - _1: (123.456).toPrecision() - }; - }) + return { + TAG: "Eq", + _0: "123.456", + _1: (123.456).toPrecision() + }; + }) ], tl: { hd: [ "toPrecision - large number", (function (param) { - return { - TAG: "Eq", - _0: "1.2e+21", - _1: (1.2e21).toPrecision() - }; - }) + return { + TAG: "Eq", + _0: "1.2e+21", + _1: (1.2e21).toPrecision() + }; + }) ], tl: { hd: [ "toPrecisionWithPrecision - digits:2", (function (param) { - return { - TAG: "Eq", - _0: "1.2e+2", - _1: (123.456).toPrecision(2) - }; - }) + return { + TAG: "Eq", + _0: "1.2e+2", + _1: (123.456).toPrecision(2) + }; + }) ], tl: { hd: [ "toPrecisionWithPrecision - digits:4", (function (param) { - return { - TAG: "Eq", - _0: "123.5", - _1: (123.456).toPrecision(4) - }; - }) + return { + TAG: "Eq", + _0: "123.5", + _1: (123.456).toPrecision(4) + }; + }) ], tl: { hd: [ "toPrecisionWithPrecision - digits:20", (function (param) { - return { - TAG: "Eq", - _0: "0.0000000000000000000", - _1: (0).toPrecision(20) - }; - }) + return { + TAG: "Eq", + _0: "0.0000000000000000000", + _1: (0).toPrecision(20) + }; + }) ], tl: { hd: [ "File \"js_float_test.res\", line 68, characters 5-12", (function (param) { - return { - TAG: "ThrowAny", - _0: (function (param) { - (0).toPrecision(101); - }) - }; - }) + return { + TAG: "ThrowAny", + _0: (function (param) { + (0).toPrecision(101); + }) + }; + }) ], tl: { hd: [ "toPrecisionWithPrecision - digits:-1", (function (param) { - return { - TAG: "ThrowAny", - _0: (function (param) { - (0).toPrecision(-1); - }) - }; - }) + return { + TAG: "ThrowAny", + _0: (function (param) { + (0).toPrecision(-1); + }) + }; + }) ], tl: { hd: [ "toString", (function (param) { - return { - TAG: "Eq", - _0: "1.23", - _1: (1.23).toString() - }; - }) + return { + TAG: "Eq", + _0: "1.23", + _1: (1.23).toString() + }; + }) ], tl: { hd: [ "toString - large number", (function (param) { - return { - TAG: "Eq", - _0: "1.2e+21", - _1: (1.2e21).toString() - }; - }) + return { + TAG: "Eq", + _0: "1.2e+21", + _1: (1.2e21).toString() + }; + }) ], tl: { hd: [ "toStringWithRadix - radix:2", (function (param) { - return { - TAG: "Eq", - _0: "1111011.0111010010111100011010100111111011111001110111", - _1: (123.456).toString(2) - }; - }) + return { + TAG: "Eq", + _0: "1111011.0111010010111100011010100111111011111001110111", + _1: (123.456).toString(2) + }; + }) ], tl: { hd: [ "toStringWithRadix - radix:16", (function (param) { - return { - TAG: "Eq", - _0: "7b.74bc6a7ef9dc", - _1: (123.456).toString(16) - }; - }) + return { + TAG: "Eq", + _0: "7b.74bc6a7ef9dc", + _1: (123.456).toString(16) + }; + }) ], tl: { hd: [ "toStringWithRadix - radix:36", (function (param) { - return { - TAG: "Eq", - _0: "3f", - _1: (123).toString(36) - }; - }) + return { + TAG: "Eq", + _0: "3f", + _1: (123).toString(36) + }; + }) ], tl: { hd: [ "toStringWithRadix - radix:37", (function (param) { - return { - TAG: "ThrowAny", - _0: (function (param) { - (0).toString(37); - }) - }; - }) + return { + TAG: "ThrowAny", + _0: (function (param) { + (0).toString(37); + }) + }; + }) ], tl: { hd: [ "toStringWithRadix - radix:1", (function (param) { - return { - TAG: "ThrowAny", - _0: (function (param) { - (0).toString(1); - }) - }; - }) + return { + TAG: "ThrowAny", + _0: (function (param) { + (0).toString(1); + }) + }; + }) ], tl: { hd: [ "toStringWithRadix - radix:-1", (function (param) { - return { - TAG: "ThrowAny", - _0: (function (param) { - (0).toString(-1); - }) - }; - }) + return { + TAG: "ThrowAny", + _0: (function (param) { + (0).toString(-1); + }) + }; + }) ], tl: { hd: [ "fromString - 123", (function (param) { - return { - TAG: "Eq", - _0: 123, - _1: Number("123") - }; - }) + return { + TAG: "Eq", + _0: 123, + _1: Number("123") + }; + }) ], tl: { hd: [ "fromString - 12.3", (function (param) { - return { - TAG: "Eq", - _0: 12.3, - _1: Number("12.3") - }; - }) + return { + TAG: "Eq", + _0: 12.3, + _1: Number("12.3") + }; + }) ], tl: { hd: [ "fromString - empty string", (function (param) { - return { - TAG: "Eq", - _0: 0, - _1: Number("") - }; - }) + return { + TAG: "Eq", + _0: 0, + _1: Number("") + }; + }) ], tl: { hd: [ "fromString - 0x11", (function (param) { - return { - TAG: "Eq", - _0: 17, - _1: Number("0x11") - }; - }) + return { + TAG: "Eq", + _0: 17, + _1: Number("0x11") + }; + }) ], tl: { hd: [ "fromString - 0b11", (function (param) { - return { - TAG: "Eq", - _0: 3, - _1: Number("0b11") - }; - }) + return { + TAG: "Eq", + _0: 3, + _1: Number("0b11") + }; + }) ], tl: { hd: [ "fromString - 0o11", (function (param) { - return { - TAG: "Eq", - _0: 9, - _1: Number("0o11") - }; - }) + return { + TAG: "Eq", + _0: 9, + _1: Number("0o11") + }; + }) ], tl: { hd: [ "fromString - invalid string", (function (param) { - return { - TAG: "Eq", - _0: true, - _1: Number.isNaN(Number("foo")) - }; - }) + return { + TAG: "Eq", + _0: true, + _1: Number.isNaN(Number("foo")) + }; + }) ], tl: /* [] */0 } diff --git a/jscomp/test/js_global_test.js b/jscomp/test/js_global_test.js index c928236606..ee7af8589b 100644 --- a/jscomp/test/js_global_test.js +++ b/jscomp/test/js_global_test.js @@ -6,74 +6,74 @@ var Mt = require("./mt.js"); var suites_0 = [ "setTimeout/clearTimeout sanity check", (function (param) { - var handle = setTimeout((function (param) { - - }), 0); - clearTimeout(handle); - return { - TAG: "Ok", - _0: true - }; - }) + var handle = setTimeout((function (param) { + + }), 0); + clearTimeout(handle); + return { + TAG: "Ok", + _0: true + }; + }) ]; var suites_1 = { hd: [ "setInerval/clearInterval sanity check", (function (param) { - var handle = setInterval((function (param) { - - }), 0); - clearInterval(handle); - return { - TAG: "Ok", - _0: true - }; - }) + var handle = setInterval((function (param) { + + }), 0); + clearInterval(handle); + return { + TAG: "Ok", + _0: true + }; + }) ], tl: { hd: [ "encodeURI", (function (param) { - return { - TAG: "Eq", - _0: encodeURI("[-=-]"), - _1: "%5B-=-%5D" - }; - }) + return { + TAG: "Eq", + _0: encodeURI("[-=-]"), + _1: "%5B-=-%5D" + }; + }) ], tl: { hd: [ "decodeURI", (function (param) { - return { - TAG: "Eq", - _0: decodeURI("%5B-=-%5D"), - _1: "[-=-]" - }; - }) + return { + TAG: "Eq", + _0: decodeURI("%5B-=-%5D"), + _1: "[-=-]" + }; + }) ], tl: { hd: [ "encodeURIComponent", (function (param) { - return { - TAG: "Eq", - _0: encodeURIComponent("[-=-]"), - _1: "%5B-%3D-%5D" - }; - }) + return { + TAG: "Eq", + _0: encodeURIComponent("[-=-]"), + _1: "%5B-%3D-%5D" + }; + }) ], tl: { hd: [ "decodeURIComponent", (function (param) { - return { - TAG: "Eq", - _0: decodeURIComponent("%5B-%3D-%5D"), - _1: "[-=-]" - }; - }) + return { + TAG: "Eq", + _0: decodeURIComponent("%5B-%3D-%5D"), + _1: "[-=-]" + }; + }) ], tl: /* [] */0 } diff --git a/jscomp/test/js_int_test.js b/jscomp/test/js_int_test.js index f54b577e3e..50e533737e 100644 --- a/jscomp/test/js_int_test.js +++ b/jscomp/test/js_int_test.js @@ -6,218 +6,218 @@ var Mt = require("./mt.js"); var suites_0 = [ "toExponential", (function (param) { - return { - TAG: "Eq", - _0: "1.23456e+5", - _1: (123456).toExponential() - }; - }) + return { + TAG: "Eq", + _0: "1.23456e+5", + _1: (123456).toExponential() + }; + }) ]; var suites_1 = { hd: [ "toExponentialWithPrecision - digits:2", (function (param) { - return { - TAG: "Eq", - _0: "1.23e+5", - _1: (123456).toExponential(2) - }; - }) + return { + TAG: "Eq", + _0: "1.23e+5", + _1: (123456).toExponential(2) + }; + }) ], tl: { hd: [ "toExponentialWithPrecision - digits:4", (function (param) { - return { - TAG: "Eq", - _0: "1.2346e+5", - _1: (123456).toExponential(4) - }; - }) + return { + TAG: "Eq", + _0: "1.2346e+5", + _1: (123456).toExponential(4) + }; + }) ], tl: { hd: [ "toExponentialWithPrecision - digits:20", (function (param) { - return { - TAG: "Eq", - _0: "0.00000000000000000000e+0", - _1: (0).toExponential(20) - }; - }) + return { + TAG: "Eq", + _0: "0.00000000000000000000e+0", + _1: (0).toExponential(20) + }; + }) ], tl: { hd: [ "File \"js_int_test.res\", line 19, characters 5-12", (function (param) { - return { - TAG: "ThrowAny", - _0: (function (param) { - (0).toExponential(101); - }) - }; - }) + return { + TAG: "ThrowAny", + _0: (function (param) { + (0).toExponential(101); + }) + }; + }) ], tl: { hd: [ "toExponentialWithPrecision - digits:-1", (function (param) { - return { - TAG: "ThrowAny", - _0: (function (param) { - (0).toExponential(-1); - }) - }; - }) + return { + TAG: "ThrowAny", + _0: (function (param) { + (0).toExponential(-1); + }) + }; + }) ], tl: { hd: [ "toPrecision", (function (param) { - return { - TAG: "Eq", - _0: "123456", - _1: (123456).toPrecision() - }; - }) + return { + TAG: "Eq", + _0: "123456", + _1: (123456).toPrecision() + }; + }) ], tl: { hd: [ "toPrecisionWithPrecision - digits:2", (function (param) { - return { - TAG: "Eq", - _0: "1.2e+5", - _1: (123456).toPrecision(2) - }; - }) + return { + TAG: "Eq", + _0: "1.2e+5", + _1: (123456).toPrecision(2) + }; + }) ], tl: { hd: [ "toPrecisionWithPrecision - digits:4", (function (param) { - return { - TAG: "Eq", - _0: "1.235e+5", - _1: (123456).toPrecision(4) - }; - }) + return { + TAG: "Eq", + _0: "1.235e+5", + _1: (123456).toPrecision(4) + }; + }) ], tl: { hd: [ "toPrecisionWithPrecision - digits:20", (function (param) { - return { - TAG: "Eq", - _0: "0.0000000000000000000", - _1: (0).toPrecision(20) - }; - }) + return { + TAG: "Eq", + _0: "0.0000000000000000000", + _1: (0).toPrecision(20) + }; + }) ], tl: { hd: [ "File \"js_int_test.res\", line 37, characters 5-12", (function (param) { - return { - TAG: "ThrowAny", - _0: (function (param) { - (0).toPrecision(101); - }) - }; - }) + return { + TAG: "ThrowAny", + _0: (function (param) { + (0).toPrecision(101); + }) + }; + }) ], tl: { hd: [ "toPrecisionWithPrecision - digits:-1", (function (param) { - return { - TAG: "ThrowAny", - _0: (function (param) { - (0).toPrecision(-1); - }) - }; - }) + return { + TAG: "ThrowAny", + _0: (function (param) { + (0).toPrecision(-1); + }) + }; + }) ], tl: { hd: [ "toString", (function (param) { - return { - TAG: "Eq", - _0: "123", - _1: (123).toString() - }; - }) + return { + TAG: "Eq", + _0: "123", + _1: (123).toString() + }; + }) ], tl: { hd: [ "toStringWithRadix - radix:2", (function (param) { - return { - TAG: "Eq", - _0: "11110001001000000", - _1: (123456).toString(2) - }; - }) + return { + TAG: "Eq", + _0: "11110001001000000", + _1: (123456).toString(2) + }; + }) ], tl: { hd: [ "toStringWithRadix - radix:16", (function (param) { - return { - TAG: "Eq", - _0: "1e240", - _1: (123456).toString(16) - }; - }) + return { + TAG: "Eq", + _0: "1e240", + _1: (123456).toString(16) + }; + }) ], tl: { hd: [ "toStringWithRadix - radix:36", (function (param) { - return { - TAG: "Eq", - _0: "2n9c", - _1: (123456).toString(36) - }; - }) + return { + TAG: "Eq", + _0: "2n9c", + _1: (123456).toString(36) + }; + }) ], tl: { hd: [ "toStringWithRadix - radix:37", (function (param) { - return { - TAG: "ThrowAny", - _0: (function (param) { - (0).toString(37); - }) - }; - }) + return { + TAG: "ThrowAny", + _0: (function (param) { + (0).toString(37); + }) + }; + }) ], tl: { hd: [ "toStringWithRadix - radix:1", (function (param) { - return { - TAG: "ThrowAny", - _0: (function (param) { - (0).toString(1); - }) - }; - }) + return { + TAG: "ThrowAny", + _0: (function (param) { + (0).toString(1); + }) + }; + }) ], tl: { hd: [ "toStringWithRadix - radix:-1", (function (param) { - return { - TAG: "ThrowAny", - _0: (function (param) { - (0).toString(-1); - }) - }; - }) + return { + TAG: "ThrowAny", + _0: (function (param) { + (0).toString(-1); + }) + }; + }) ], tl: /* [] */0 } diff --git a/jscomp/test/js_json_test.js b/jscomp/test/js_json_test.js index e88a76d155..6b4a0e1fa8 100644 --- a/jscomp/test/js_json_test.js +++ b/jscomp/test/js_json_test.js @@ -32,99 +32,99 @@ function add_test(loc, test) { function eq(loc, x, y) { add_test(loc, (function (param) { - return { - TAG: "Eq", - _0: x, - _1: y - }; - })); + return { + TAG: "Eq", + _0: x, + _1: y + }; + })); } function false_(loc) { add_test(loc, (function (param) { - return { - TAG: "Ok", - _0: false - }; - })); + return { + TAG: "Ok", + _0: false + }; + })); } function true_(loc) { add_test(loc, (function (param) { - return { - TAG: "Ok", - _0: true - }; - })); + return { + TAG: "Ok", + _0: true + }; + })); } var v = JSON.parse(" { \"x\" : [1, 2, 3 ] } "); add_test("File \"js_json_test.res\", line 22, characters 11-18", (function (param) { - var ty = Js_json.classify(v); - if (typeof ty !== "object") { - return { - TAG: "Ok", - _0: false - }; - } - if (ty.TAG !== "JSONObject") { - return { - TAG: "Ok", - _0: false - }; - } - var v$1 = Js_dict.get(ty._0, "x"); - if (v$1 === undefined) { - return { - TAG: "Ok", - _0: false - }; - } - var ty2 = Js_json.classify(v$1); - if (typeof ty2 !== "object") { - return { - TAG: "Ok", - _0: false - }; - } - if (ty2.TAG !== "JSONArray") { - return { - TAG: "Ok", - _0: false - }; - } - ty2._0.forEach(function (x) { - var ty3 = Js_json.classify(x); - if (typeof ty3 !== "object") { - throw { - RE_EXN_ID: "Assert_failure", - _1: [ - "js_json_test.res", - 37, - 19 - ], - Error: new Error() - }; - } - if (ty3.TAG === "JSONNumber") { - return; - } - throw { - RE_EXN_ID: "Assert_failure", - _1: [ - "js_json_test.res", - 37, - 19 - ], - Error: new Error() - }; - }); - return { - TAG: "Ok", - _0: true - }; - })); + var ty = Js_json.classify(v); + if (typeof ty !== "object") { + return { + TAG: "Ok", + _0: false + }; + } + if (ty.TAG !== "JSONObject") { + return { + TAG: "Ok", + _0: false + }; + } + var v$1 = Js_dict.get(ty._0, "x"); + if (v$1 === undefined) { + return { + TAG: "Ok", + _0: false + }; + } + var ty2 = Js_json.classify(v$1); + if (typeof ty2 !== "object") { + return { + TAG: "Ok", + _0: false + }; + } + if (ty2.TAG !== "JSONArray") { + return { + TAG: "Ok", + _0: false + }; + } + ty2._0.forEach(function (x) { + var ty3 = Js_json.classify(x); + if (typeof ty3 !== "object") { + throw { + RE_EXN_ID: "Assert_failure", + _1: [ + "js_json_test.res", + 37, + 19 + ], + Error: new Error() + }; + } + if (ty3.TAG === "JSONNumber") { + return; + } + throw { + RE_EXN_ID: "Assert_failure", + _1: [ + "js_json_test.res", + 37, + 19 + ], + Error: new Error() + }; + }); + return { + TAG: "Ok", + _0: true + }; +})); eq("File \"js_json_test.res\", line 48, characters 5-12", Js_json.test(v, "Object"), true); @@ -135,28 +135,28 @@ var ty = Js_json.classify(json); if (typeof ty !== "object") { if (ty === "JSONNull") { add_test("File \"js_json_test.res\", line 55, characters 24-31", (function (param) { - return { - TAG: "Ok", - _0: true - }; - })); + return { + TAG: "Ok", + _0: true + }; + })); } else { console.log(ty); add_test("File \"js_json_test.res\", line 58, characters 11-18", (function (param) { - return { - TAG: "Ok", - _0: false - }; - })); + return { + TAG: "Ok", + _0: false + }; + })); } } else { console.log(ty); add_test("File \"js_json_test.res\", line 58, characters 11-18", (function (param) { - return { - TAG: "Ok", - _0: false - }; - })); + return { + TAG: "Ok", + _0: false + }; + })); } var json$1 = JSON.parse(JSON.stringify("test string")); @@ -165,20 +165,20 @@ var ty$1 = Js_json.classify(json$1); if (typeof ty$1 !== "object") { add_test("File \"js_json_test.res\", line 68, characters 16-23", (function (param) { - return { - TAG: "Ok", - _0: false - }; - })); + return { + TAG: "Ok", + _0: false + }; + })); } else if (ty$1.TAG === "JSONString") { eq("File \"js_json_test.res\", line 67, characters 26-33", ty$1._0, "test string"); } else { add_test("File \"js_json_test.res\", line 68, characters 16-23", (function (param) { - return { - TAG: "Ok", - _0: false - }; - })); + return { + TAG: "Ok", + _0: false + }; + })); } var json$2 = JSON.parse(JSON.stringify(1.23456789)); @@ -195,11 +195,11 @@ if (typeof ty$2 !== "object" || ty$2.TAG !== "JSONNumber") { if (exit === 1) { add_test("File \"js_json_test.res\", line 78, characters 18-25", (function (param) { - return { - TAG: "Ok", - _0: false - }; - })); + return { + TAG: "Ok", + _0: false + }; + })); } var json$3 = JSON.parse(JSON.stringify(-1347440721)); @@ -216,11 +216,11 @@ if (typeof ty$3 !== "object" || ty$3.TAG !== "JSONNumber") { if (exit$1 === 1) { add_test("File \"js_json_test.res\", line 88, characters 18-25", (function (param) { - return { - TAG: "Ok", - _0: false - }; - })); + return { + TAG: "Ok", + _0: false + }; + })); } function test(v) { @@ -228,11 +228,11 @@ function test(v) { var ty = Js_json.classify(json); if (typeof ty === "object") { return add_test("File \"js_json_test.res\", line 100, characters 18-25", (function (param) { - return { - TAG: "Ok", - _0: false - }; - })); + return { + TAG: "Ok", + _0: false + }; + })); } switch (ty) { case "JSONFalse" : @@ -241,11 +241,11 @@ function test(v) { return eq("File \"js_json_test.res\", line 98, characters 23-30", true, v); default: return add_test("File \"js_json_test.res\", line 100, characters 18-25", (function (param) { - return { - TAG: "Ok", - _0: false - }; - })); + return { + TAG: "Ok", + _0: false + }; + })); } } @@ -280,173 +280,173 @@ var ty$4 = Js_json.classify(json$4); if (typeof ty$4 !== "object") { add_test("File \"js_json_test.res\", line 142, characters 16-23", (function (param) { - return { - TAG: "Ok", - _0: false - }; - })); + return { + TAG: "Ok", + _0: false + }; + })); } else if (ty$4.TAG === "JSONObject") { var x = ty$4._0; var ta = Js_json.classify(option_get(Js_dict.get(x, "a"))); if (typeof ta !== "object") { add_test("File \"js_json_test.res\", line 140, characters 18-25", (function (param) { - return { - TAG: "Ok", - _0: false - }; - })); + return { + TAG: "Ok", + _0: false + }; + })); } else if (ta.TAG === "JSONString") { if (ta._0 !== "test string") { add_test("File \"js_json_test.res\", line 131, characters 15-22", (function (param) { - return { - TAG: "Ok", - _0: false - }; - })); + return { + TAG: "Ok", + _0: false + }; + })); } else { var ty$5 = Js_json.classify(option_get(Js_dict.get(x, "b"))); if (typeof ty$5 !== "object") { add_test("File \"js_json_test.res\", line 137, characters 22-29", (function (param) { - return { - TAG: "Ok", - _0: false - }; - })); + return { + TAG: "Ok", + _0: false + }; + })); } else if (ty$5.TAG === "JSONNumber") { var b = ty$5._0; add_test("File \"js_json_test.res\", line 136, characters 38-45", (function (param) { - return { - TAG: "Approx", - _0: 123.0, - _1: b - }; - })); + return { + TAG: "Approx", + _0: 123.0, + _1: b + }; + })); } else { add_test("File \"js_json_test.res\", line 137, characters 22-29", (function (param) { - return { - TAG: "Ok", - _0: false - }; - })); + return { + TAG: "Ok", + _0: false + }; + })); } } } else { add_test("File \"js_json_test.res\", line 140, characters 18-25", (function (param) { - return { - TAG: "Ok", - _0: false - }; - })); + return { + TAG: "Ok", + _0: false + }; + })); } } else { add_test("File \"js_json_test.res\", line 142, characters 16-23", (function (param) { - return { - TAG: "Ok", - _0: false - }; - })); + return { + TAG: "Ok", + _0: false + }; + })); } function eq_at_i(loc, json, i, kind, expected) { var ty = Js_json.classify(json); if (typeof ty !== "object") { return add_test(loc, (function (param) { - return { - TAG: "Ok", - _0: false - }; - })); + return { + TAG: "Ok", + _0: false + }; + })); } if (ty.TAG !== "JSONArray") { return add_test(loc, (function (param) { - return { - TAG: "Ok", - _0: false - }; - })); + return { + TAG: "Ok", + _0: false + }; + })); } var ty$1 = Js_json.classify(Caml_array.get(ty._0, i)); switch (kind) { case "String" : if (typeof ty$1 !== "object") { return add_test(loc, (function (param) { - return { - TAG: "Ok", - _0: false - }; - })); + return { + TAG: "Ok", + _0: false + }; + })); } else if (ty$1.TAG === "JSONString") { return eq(loc, ty$1._0, expected); } else { return add_test(loc, (function (param) { - return { - TAG: "Ok", - _0: false - }; - })); + return { + TAG: "Ok", + _0: false + }; + })); } case "Number" : if (typeof ty$1 !== "object") { return add_test(loc, (function (param) { - return { - TAG: "Ok", - _0: false - }; - })); + return { + TAG: "Ok", + _0: false + }; + })); } else if (ty$1.TAG === "JSONNumber") { return eq(loc, ty$1._0, expected); } else { return add_test(loc, (function (param) { - return { - TAG: "Ok", - _0: false - }; - })); + return { + TAG: "Ok", + _0: false + }; + })); } case "Object" : if (typeof ty$1 !== "object") { return add_test(loc, (function (param) { - return { - TAG: "Ok", - _0: false - }; - })); + return { + TAG: "Ok", + _0: false + }; + })); } else if (ty$1.TAG === "JSONObject") { return eq(loc, ty$1._0, expected); } else { return add_test(loc, (function (param) { - return { - TAG: "Ok", - _0: false - }; - })); + return { + TAG: "Ok", + _0: false + }; + })); } case "Array" : if (typeof ty$1 !== "object") { return add_test(loc, (function (param) { - return { - TAG: "Ok", - _0: false - }; - })); + return { + TAG: "Ok", + _0: false + }; + })); } else if (ty$1.TAG === "JSONArray") { return eq(loc, ty$1._0, expected); } else { return add_test(loc, (function (param) { - return { - TAG: "Ok", - _0: false - }; - })); + return { + TAG: "Ok", + _0: false + }; + })); } case "Boolean" : if (typeof ty$1 === "object") { return add_test(loc, (function (param) { - return { - TAG: "Ok", - _0: false - }; - })); + return { + TAG: "Ok", + _0: false + }; + })); } switch (ty$1) { case "JSONFalse" : @@ -455,48 +455,48 @@ function eq_at_i(loc, json, i, kind, expected) { return eq(loc, true, expected); default: return add_test(loc, (function (param) { - return { - TAG: "Ok", - _0: false - }; - })); + return { + TAG: "Ok", + _0: false + }; + })); } case "Null" : if (typeof ty$1 !== "object") { if (ty$1 === "JSONNull") { return add_test(loc, (function (param) { - return { - TAG: "Ok", - _0: true - }; - })); + return { + TAG: "Ok", + _0: true + }; + })); } else { return add_test(loc, (function (param) { - return { - TAG: "Ok", - _0: false - }; - })); + return { + TAG: "Ok", + _0: false + }; + })); } } else { return add_test(loc, (function (param) { - return { - TAG: "Ok", - _0: false - }; - })); + return { + TAG: "Ok", + _0: false + }; + })); } } } var json$5 = JSON.parse(JSON.stringify($$Array.map((function (prim) { - return prim; - }), [ - "string 0", - "string 1", - "string 2" - ]))); + return prim; +}), [ + "string 0", + "string 1", + "string 2" +]))); eq_at_i("File \"js_json_test.res\", line 199, characters 10-17", json$5, 0, "String", "string 0"); @@ -505,10 +505,10 @@ eq_at_i("File \"js_json_test.res\", line 200, characters 10-17", json$5, 1, "Str eq_at_i("File \"js_json_test.res\", line 201, characters 10-17", json$5, 2, "String", "string 2"); var json$6 = JSON.parse(JSON.stringify([ - "string 0", - "string 1", - "string 2" - ])); + "string 0", + "string 1", + "string 2" +])); eq_at_i("File \"js_json_test.res\", line 208, characters 10-17", json$6, 0, "String", "string 0"); @@ -537,8 +537,8 @@ var a$1 = [ ]; var json$8 = JSON.parse(JSON.stringify($$Array.map((function (prim) { - return prim; - }), a$1))); + return prim; +}), a$1))); eq_at_i("File \"js_json_test.res\", line 230, characters 10-17", json$8, 0, "Number", Caml_array.get(a$1, 0)); @@ -578,87 +578,87 @@ var ty$6 = Js_json.classify(json$10); if (typeof ty$6 !== "object") { add_test("File \"js_json_test.res\", line 271, characters 16-23", (function (param) { - return { - TAG: "Ok", - _0: false - }; - })); + return { + TAG: "Ok", + _0: false + }; + })); } else if (ty$6.TAG === "JSONArray") { var ty$7 = Js_json.classify(Caml_array.get(ty$6._0, 1)); if (typeof ty$7 !== "object") { add_test("File \"js_json_test.res\", line 269, characters 18-25", (function (param) { - return { - TAG: "Ok", - _0: false - }; - })); + return { + TAG: "Ok", + _0: false + }; + })); } else if (ty$7.TAG === "JSONObject") { var ty$8 = Js_json.classify(option_get(Js_dict.get(ty$7._0, "a"))); if (typeof ty$8 !== "object") { add_test("File \"js_json_test.res\", line 267, characters 20-27", (function (param) { - return { - TAG: "Ok", - _0: false - }; - })); + return { + TAG: "Ok", + _0: false + }; + })); } else if (ty$8.TAG === "JSONString") { eq("File \"js_json_test.res\", line 266, characters 35-42", ty$8._0, "bbb"); } else { add_test("File \"js_json_test.res\", line 267, characters 20-27", (function (param) { - return { - TAG: "Ok", - _0: false - }; - })); + return { + TAG: "Ok", + _0: false + }; + })); } } else { add_test("File \"js_json_test.res\", line 269, characters 18-25", (function (param) { - return { - TAG: "Ok", - _0: false - }; - })); + return { + TAG: "Ok", + _0: false + }; + })); } } else { add_test("File \"js_json_test.res\", line 271, characters 16-23", (function (param) { - return { - TAG: "Ok", - _0: false - }; - })); + return { + TAG: "Ok", + _0: false + }; + })); } try { JSON.parse("{{ A}"); add_test("File \"js_json_test.res\", line 279, characters 11-18", (function (param) { - return { - TAG: "Ok", - _0: false - }; - })); + return { + TAG: "Ok", + _0: false + }; + })); } catch (exn){ add_test("File \"js_json_test.res\", line 281, characters 17-24", (function (param) { - return { - TAG: "Ok", - _0: true - }; - })); + return { + TAG: "Ok", + _0: true + }; + })); } eq("File \"js_json_test.res\", line 287, characters 12-19", JSON.stringify([ - 1, - 2, - 3 - ]), "[1,2,3]"); + 1, + 2, + 3 +]), "[1,2,3]"); eq("File \"js_json_test.res\", line 290, characters 2-9", JSON.stringify({ - foo: 1, - bar: "hello", - baz: { - baaz: 10 - } - }), "{\"foo\":1,\"bar\":\"hello\",\"baz\":{\"baaz\":10}}"); + foo: 1, + bar: "hello", + baz: { + baaz: 10 + } +}), "{\"foo\":1,\"bar\":\"hello\",\"baz\":{\"baaz\":10}}"); eq("File \"js_json_test.res\", line 295, characters 12-19", JSON.stringify(null), "null"); @@ -747,29 +747,29 @@ function idtest(obj) { idtest(undefined); idtest({ - hd: [ - undefined, - undefined, - undefined - ], - tl: /* [] */0 - }); + hd: [ + undefined, + undefined, + undefined + ], + tl: /* [] */0 +}); idtest(Belt_List.makeBy(500, (function (i) { - if (i % 2 === 0) { - return; - } else { - return 1; - } - }))); + if (i % 2 === 0) { + return; + } else { + return 1; + } +}))); idtest(Belt_Array.makeBy(500, (function (i) { - if (i % 2 === 0) { - return; - } else { - return 1; - } - }))); + if (i % 2 === 0) { + return; + } else { + return 1; + } +}))); Mt.from_pair_suites("Js_json_test", suites.contents); diff --git a/jscomp/test/js_list_test.js b/jscomp/test/js_list_test.js index 3a000f0c19..acfb0db176 100644 --- a/jscomp/test/js_list_test.js +++ b/jscomp/test/js_list_test.js @@ -19,159 +19,159 @@ function eq(loc, x, y) { hd: [ loc + (" id " + String(test_id.contents)), (function (param) { - return { - TAG: "Eq", - _0: x, - _1: y - }; - }) + return { + TAG: "Eq", + _0: x, + _1: y + }; + }) ], tl: suites.contents }; } eq("File \"js_list_test.res\", line 11, characters 4-11", Js_list.flatten({ - hd: { - hd: 1, - tl: { - hd: 2, - tl: /* [] */0 - } - }, + hd: { + hd: 1, + tl: { + hd: 2, + tl: /* [] */0 + } + }, + tl: { + hd: { + hd: 3, + tl: /* [] */0 + }, + tl: { + hd: /* [] */0, + tl: { + hd: { + hd: 1, tl: { - hd: { + hd: 2, + tl: { hd: 3, tl: /* [] */0 - }, - tl: { - hd: /* [] */0, - tl: { - hd: { - hd: 1, - tl: { - hd: 2, - tl: { - hd: 3, - tl: /* [] */0 - } - } - }, - tl: /* [] */0 - } } } - }), { - hd: 1, + }, + tl: /* [] */0 + } + } + } +}), { + hd: 1, + tl: { + hd: 2, + tl: { + hd: 3, tl: { - hd: 2, + hd: 1, tl: { - hd: 3, + hd: 2, tl: { - hd: 1, - tl: { - hd: 2, - tl: { - hd: 3, - tl: /* [] */0 - } - } + hd: 3, + tl: /* [] */0 } } } - }); + } + } +}); eq("File \"js_list_test.res\", line 15, characters 5-12", Js_list.filterMap((function (x) { - if (x % 2 === 0) { - return x; - } - - }), { - hd: 1, + if (x % 2 === 0) { + return x; + } + +}), { + hd: 1, + tl: { + hd: 2, + tl: { + hd: 3, + tl: { + hd: 4, + tl: { + hd: 5, tl: { - hd: 2, + hd: 6, tl: { - hd: 3, - tl: { - hd: 4, - tl: { - hd: 5, - tl: { - hd: 6, - tl: { - hd: 7, - tl: /* [] */0 - } - } - } - } + hd: 7, + tl: /* [] */0 } } - }), { - hd: 2, - tl: { - hd: 4, - tl: { - hd: 6, - tl: /* [] */0 } } - }); + } + } +}), { + hd: 2, + tl: { + hd: 4, + tl: { + hd: 6, + tl: /* [] */0 + } + } +}); eq("File \"js_list_test.res\", line 22, characters 5-12", Js_list.filterMap((function (x) { - if (x % 2 === 0) { - return x; - } - - }), { - hd: 1, - tl: { - hd: 2, - tl: { - hd: 3, - tl: { - hd: 4, - tl: { - hd: 5, - tl: { - hd: 6, - tl: /* [] */0 - } - } - } - } - } - }), { - hd: 2, + if (x % 2 === 0) { + return x; + } + +}), { + hd: 1, + tl: { + hd: 2, + tl: { + hd: 3, tl: { hd: 4, tl: { - hd: 6, - tl: /* [] */0 + hd: 5, + tl: { + hd: 6, + tl: /* [] */0 + } } } - }); + } + } +}), { + hd: 2, + tl: { + hd: 4, + tl: { + hd: 6, + tl: /* [] */0 + } + } +}); eq("File \"js_list_test.res\", line 29, characters 5-12", Js_list.countBy((function (x) { - return x % 2 === 0; - }), { - hd: 1, + return x % 2 === 0; +}), { + hd: 1, + tl: { + hd: 2, + tl: { + hd: 3, + tl: { + hd: 4, + tl: { + hd: 5, tl: { - hd: 2, - tl: { - hd: 3, - tl: { - hd: 4, - tl: { - hd: 5, - tl: { - hd: 6, - tl: /* [] */0 - } - } - } - } + hd: 6, + tl: /* [] */0 } - }), 3); + } + } + } + } +}), 3); function f(i) { return i; @@ -180,23 +180,23 @@ function f(i) { var v = Js_vector.toList(Js_vector.init(100000, f)); eq("File \"js_list_test.res\", line 31, characters 5-12", Js_list.countBy((function (x) { - return x % 2 === 0; - }), v), 50000); + return x % 2 === 0; +}), v), 50000); var vv = Js_list.foldRight((function (x, y) { - return { - hd: x, - tl: y - }; - }), v, /* [] */0); + return { + hd: x, + tl: y + }; +}), v, /* [] */0); eq("File \"js_list_test.res\", line 33, characters 5-12", true, Js_list.equal((function (x, y) { - return x === y; - }), v, vv)); + return x === y; +}), v, vv)); var vvv = Js_list.filter((function (x) { - return x % 10 === 0; - }), vv); + return x % 10 === 0; +}), vv); eq("File \"js_list_test.res\", line 36, characters 5-12", Js_list.length(vvv), 10000); @@ -205,8 +205,8 @@ function f$1(x) { } eq("File \"js_list_test.res\", line 37, characters 5-12", true, Js_list.equal((function (x, y) { - return x === y; - }), vvv, Js_vector.toList(Js_vector.init(10000, f$1)))); + return x === y; +}), vvv, Js_vector.toList(Js_vector.init(10000, f$1)))); Mt.from_pair_suites("Js_list_test", suites.contents); diff --git a/jscomp/test/js_math_test.js b/jscomp/test/js_math_test.js index 514952a094..b7ca5e9810 100644 --- a/jscomp/test/js_math_test.js +++ b/jscomp/test/js_math_test.js @@ -7,670 +7,670 @@ var Js_math = require("../../lib/js/js_math.js"); var suites_0 = [ "_E", (function (param) { - return { - TAG: "ApproxThreshold", - _0: 0.001, - _1: 2.718, - _2: Math.E - }; - }) + return { + TAG: "ApproxThreshold", + _0: 0.001, + _1: 2.718, + _2: Math.E + }; + }) ]; var suites_1 = { hd: [ "_LN2", (function (param) { - return { - TAG: "ApproxThreshold", - _0: 0.001, - _1: 0.693, - _2: Math.LN2 - }; - }) + return { + TAG: "ApproxThreshold", + _0: 0.001, + _1: 0.693, + _2: Math.LN2 + }; + }) ], tl: { hd: [ "_LN10", (function (param) { - return { - TAG: "ApproxThreshold", - _0: 0.001, - _1: 2.303, - _2: Math.LN10 - }; - }) + return { + TAG: "ApproxThreshold", + _0: 0.001, + _1: 2.303, + _2: Math.LN10 + }; + }) ], tl: { hd: [ "_LOG2E", (function (param) { - return { - TAG: "ApproxThreshold", - _0: 0.001, - _1: 1.443, - _2: Math.LOG2E - }; - }) + return { + TAG: "ApproxThreshold", + _0: 0.001, + _1: 1.443, + _2: Math.LOG2E + }; + }) ], tl: { hd: [ "_LOG10E", (function (param) { - return { - TAG: "ApproxThreshold", - _0: 0.001, - _1: 0.434, - _2: Math.LOG10E - }; - }) + return { + TAG: "ApproxThreshold", + _0: 0.001, + _1: 0.434, + _2: Math.LOG10E + }; + }) ], tl: { hd: [ "_PI", (function (param) { - return { - TAG: "ApproxThreshold", - _0: 0.00001, - _1: 3.14159, - _2: Math.PI - }; - }) + return { + TAG: "ApproxThreshold", + _0: 0.00001, + _1: 3.14159, + _2: Math.PI + }; + }) ], tl: { hd: [ "_SQRT1_2", (function (param) { - return { - TAG: "ApproxThreshold", - _0: 0.001, - _1: 0.707, - _2: Math.SQRT1_2 - }; - }) + return { + TAG: "ApproxThreshold", + _0: 0.001, + _1: 0.707, + _2: Math.SQRT1_2 + }; + }) ], tl: { hd: [ "_SQRT2", (function (param) { - return { - TAG: "ApproxThreshold", - _0: 0.001, - _1: 1.414, - _2: Math.SQRT2 - }; - }) + return { + TAG: "ApproxThreshold", + _0: 0.001, + _1: 1.414, + _2: Math.SQRT2 + }; + }) ], tl: { hd: [ "abs_int", (function (param) { - return { - TAG: "Eq", - _0: 4, - _1: Math.abs(-4) - }; - }) + return { + TAG: "Eq", + _0: 4, + _1: Math.abs(-4) + }; + }) ], tl: { hd: [ "abs_float", (function (param) { - return { - TAG: "Eq", - _0: 1.2, - _1: Math.abs(-1.2) - }; - }) + return { + TAG: "Eq", + _0: 1.2, + _1: Math.abs(-1.2) + }; + }) ], tl: { hd: [ "acos", (function (param) { - return { - TAG: "ApproxThreshold", - _0: 0.001, - _1: 1.159, - _2: Math.acos(0.4) - }; - }) + return { + TAG: "ApproxThreshold", + _0: 0.001, + _1: 1.159, + _2: Math.acos(0.4) + }; + }) ], tl: { hd: [ "acosh", (function (param) { - return { - TAG: "ApproxThreshold", - _0: 0.001, - _1: 0.622, - _2: Math.acosh(1.2) - }; - }) + return { + TAG: "ApproxThreshold", + _0: 0.001, + _1: 0.622, + _2: Math.acosh(1.2) + }; + }) ], tl: { hd: [ "asin", (function (param) { - return { - TAG: "ApproxThreshold", - _0: 0.001, - _1: 0.411, - _2: Math.asin(0.4) - }; - }) + return { + TAG: "ApproxThreshold", + _0: 0.001, + _1: 0.411, + _2: Math.asin(0.4) + }; + }) ], tl: { hd: [ "asinh", (function (param) { - return { - TAG: "ApproxThreshold", - _0: 0.001, - _1: 0.390, - _2: Math.asinh(0.4) - }; - }) + return { + TAG: "ApproxThreshold", + _0: 0.001, + _1: 0.390, + _2: Math.asinh(0.4) + }; + }) ], tl: { hd: [ "atan", (function (param) { - return { - TAG: "ApproxThreshold", - _0: 0.001, - _1: 0.380, - _2: Math.atan(0.4) - }; - }) + return { + TAG: "ApproxThreshold", + _0: 0.001, + _1: 0.380, + _2: Math.atan(0.4) + }; + }) ], tl: { hd: [ "atanh", (function (param) { - return { - TAG: "ApproxThreshold", - _0: 0.001, - _1: 0.423, - _2: Math.atanh(0.4) - }; - }) + return { + TAG: "ApproxThreshold", + _0: 0.001, + _1: 0.423, + _2: Math.atanh(0.4) + }; + }) ], tl: { hd: [ "atan2", (function (param) { - return { - TAG: "ApproxThreshold", - _0: 0.001, - _1: 0.588, - _2: Math.atan2(0.4, 0.6) - }; - }) + return { + TAG: "ApproxThreshold", + _0: 0.001, + _1: 0.588, + _2: Math.atan2(0.4, 0.6) + }; + }) ], tl: { hd: [ "cbrt", (function (param) { - return { - TAG: "Eq", - _0: 2, - _1: Math.cbrt(8) - }; - }) + return { + TAG: "Eq", + _0: 2, + _1: Math.cbrt(8) + }; + }) ], tl: { hd: [ "unsafe_ceil_int", (function (param) { - return { - TAG: "Eq", - _0: 4, - _1: Math.ceil(3.2) - }; - }) + return { + TAG: "Eq", + _0: 4, + _1: Math.ceil(3.2) + }; + }) ], tl: { hd: [ "ceil_int", (function (param) { - return { - TAG: "Eq", - _0: 4, - _1: Js_math.ceil_int(3.2) - }; - }) + return { + TAG: "Eq", + _0: 4, + _1: Js_math.ceil_int(3.2) + }; + }) ], tl: { hd: [ "ceil_float", (function (param) { - return { - TAG: "Eq", - _0: 4, - _1: Math.ceil(3.2) - }; - }) + return { + TAG: "Eq", + _0: 4, + _1: Math.ceil(3.2) + }; + }) ], tl: { hd: [ "cos", (function (param) { - return { - TAG: "ApproxThreshold", - _0: 0.001, - _1: 0.921, - _2: Math.cos(0.4) - }; - }) + return { + TAG: "ApproxThreshold", + _0: 0.001, + _1: 0.921, + _2: Math.cos(0.4) + }; + }) ], tl: { hd: [ "cosh", (function (param) { - return { - TAG: "ApproxThreshold", - _0: 0.001, - _1: 1.081, - _2: Math.cosh(0.4) - }; - }) + return { + TAG: "ApproxThreshold", + _0: 0.001, + _1: 1.081, + _2: Math.cosh(0.4) + }; + }) ], tl: { hd: [ "exp", (function (param) { - return { - TAG: "ApproxThreshold", - _0: 0.001, - _1: 1.491, - _2: Math.exp(0.4) - }; - }) + return { + TAG: "ApproxThreshold", + _0: 0.001, + _1: 1.491, + _2: Math.exp(0.4) + }; + }) ], tl: { hd: [ "expm1", (function (param) { - return { - TAG: "ApproxThreshold", - _0: 0.001, - _1: 0.491, - _2: Math.expm1(0.4) - }; - }) + return { + TAG: "ApproxThreshold", + _0: 0.001, + _1: 0.491, + _2: Math.expm1(0.4) + }; + }) ], tl: { hd: [ "unsafe_floor_int", (function (param) { - return { - TAG: "Eq", - _0: 3, - _1: Math.floor(3.2) - }; - }) + return { + TAG: "Eq", + _0: 3, + _1: Math.floor(3.2) + }; + }) ], tl: { hd: [ "floor_int", (function (param) { - return { - TAG: "Eq", - _0: 3, - _1: Js_math.floor_int(3.2) - }; - }) + return { + TAG: "Eq", + _0: 3, + _1: Js_math.floor_int(3.2) + }; + }) ], tl: { hd: [ "floor_float", (function (param) { - return { - TAG: "Eq", - _0: 3, - _1: Math.floor(3.2) - }; - }) + return { + TAG: "Eq", + _0: 3, + _1: Math.floor(3.2) + }; + }) ], tl: { hd: [ "fround", (function (param) { - return { - TAG: "Approx", - _0: 3.2, - _1: Math.fround(3.2) - }; - }) + return { + TAG: "Approx", + _0: 3.2, + _1: Math.fround(3.2) + }; + }) ], tl: { hd: [ "hypot", (function (param) { - return { - TAG: "ApproxThreshold", - _0: 0.001, - _1: 0.721, - _2: Math.hypot(0.4, 0.6) - }; - }) + return { + TAG: "ApproxThreshold", + _0: 0.001, + _1: 0.721, + _2: Math.hypot(0.4, 0.6) + }; + }) ], tl: { hd: [ "hypotMany", (function (param) { - return { - TAG: "ApproxThreshold", - _0: 0.001, - _1: 1.077, - _2: Math.hypot(0.4, 0.6, 0.8) - }; - }) + return { + TAG: "ApproxThreshold", + _0: 0.001, + _1: 1.077, + _2: Math.hypot(0.4, 0.6, 0.8) + }; + }) ], tl: { hd: [ "imul", (function (param) { - return { - TAG: "Eq", - _0: 8, - _1: Math.imul(4, 2) - }; - }) + return { + TAG: "Eq", + _0: 8, + _1: Math.imul(4, 2) + }; + }) ], tl: { hd: [ "log", (function (param) { - return { - TAG: "ApproxThreshold", - _0: 0.001, - _1: -0.916, - _2: Math.log(0.4) - }; - }) + return { + TAG: "ApproxThreshold", + _0: 0.001, + _1: -0.916, + _2: Math.log(0.4) + }; + }) ], tl: { hd: [ "log1p", (function (param) { - return { - TAG: "ApproxThreshold", - _0: 0.001, - _1: 0.336, - _2: Math.log1p(0.4) - }; - }) + return { + TAG: "ApproxThreshold", + _0: 0.001, + _1: 0.336, + _2: Math.log1p(0.4) + }; + }) ], tl: { hd: [ "log10", (function (param) { - return { - TAG: "ApproxThreshold", - _0: 0.001, - _1: -0.397, - _2: Math.log10(0.4) - }; - }) + return { + TAG: "ApproxThreshold", + _0: 0.001, + _1: -0.397, + _2: Math.log10(0.4) + }; + }) ], tl: { hd: [ "log2", (function (param) { - return { - TAG: "ApproxThreshold", - _0: 0.001, - _1: -1.321, - _2: Math.log2(0.4) - }; - }) + return { + TAG: "ApproxThreshold", + _0: 0.001, + _1: -1.321, + _2: Math.log2(0.4) + }; + }) ], tl: { hd: [ "max_int", (function (param) { - return { - TAG: "Eq", - _0: 4, - _1: Math.max(2, 4) - }; - }) + return { + TAG: "Eq", + _0: 4, + _1: Math.max(2, 4) + }; + }) ], tl: { hd: [ "maxMany_int", (function (param) { - return { - TAG: "Eq", - _0: 4, - _1: Math.max(2, 4, 3) - }; - }) + return { + TAG: "Eq", + _0: 4, + _1: Math.max(2, 4, 3) + }; + }) ], tl: { hd: [ "max_float", (function (param) { - return { - TAG: "Eq", - _0: 4.2, - _1: Math.max(2.7, 4.2) - }; - }) + return { + TAG: "Eq", + _0: 4.2, + _1: Math.max(2.7, 4.2) + }; + }) ], tl: { hd: [ "maxMany_float", (function (param) { - return { - TAG: "Eq", - _0: 4.2, - _1: Math.max(2.7, 4.2, 3.9) - }; - }) + return { + TAG: "Eq", + _0: 4.2, + _1: Math.max(2.7, 4.2, 3.9) + }; + }) ], tl: { hd: [ "min_int", (function (param) { - return { - TAG: "Eq", - _0: 2, - _1: Math.min(2, 4) - }; - }) + return { + TAG: "Eq", + _0: 2, + _1: Math.min(2, 4) + }; + }) ], tl: { hd: [ "minMany_int", (function (param) { - return { - TAG: "Eq", - _0: 2, - _1: Math.min(2, 4, 3) - }; - }) + return { + TAG: "Eq", + _0: 2, + _1: Math.min(2, 4, 3) + }; + }) ], tl: { hd: [ "min_float", (function (param) { - return { - TAG: "Eq", - _0: 2.7, - _1: Math.min(2.7, 4.2) - }; - }) + return { + TAG: "Eq", + _0: 2.7, + _1: Math.min(2.7, 4.2) + }; + }) ], tl: { hd: [ "minMany_float", (function (param) { - return { - TAG: "Eq", - _0: 2.7, - _1: Math.min(2.7, 4.2, 3.9) - }; - }) + return { + TAG: "Eq", + _0: 2.7, + _1: Math.min(2.7, 4.2, 3.9) + }; + }) ], tl: { hd: [ "random", (function (param) { - var a = Math.random(); - return { - TAG: "Ok", - _0: a >= 0 && a < 1 - }; - }) + var a = Math.random(); + return { + TAG: "Ok", + _0: a >= 0 && a < 1 + }; + }) ], tl: { hd: [ "random_int", (function (param) { - var a = Js_math.random_int(1, 3); - return { - TAG: "Ok", - _0: a >= 1 && a < 3 - }; - }) + var a = Js_math.random_int(1, 3); + return { + TAG: "Ok", + _0: a >= 1 && a < 3 + }; + }) ], tl: { hd: [ "unsafe_round", (function (param) { + return { + TAG: "Eq", + _0: 3, + _1: Math.round(3.2) + }; + }) + ], + tl: { + hd: [ + "round", + (function (param) { return { TAG: "Eq", _0: 3, _1: Math.round(3.2) }; }) - ], - tl: { - hd: [ - "round", - (function (param) { - return { - TAG: "Eq", - _0: 3, - _1: Math.round(3.2) - }; - }) ], tl: { hd: [ "sign_int", (function (param) { - return { - TAG: "Eq", - _0: -1, - _1: Math.sign(-4) - }; - }) + return { + TAG: "Eq", + _0: -1, + _1: Math.sign(-4) + }; + }) ], tl: { hd: [ "sign_float", (function (param) { - return { - TAG: "Eq", - _0: -1, - _1: Math.sign(-4.2) - }; - }) + return { + TAG: "Eq", + _0: -1, + _1: Math.sign(-4.2) + }; + }) ], tl: { hd: [ "sign_float -0", (function (param) { - return { - TAG: "Eq", - _0: -0, - _1: Math.sign(-0) - }; - }) + return { + TAG: "Eq", + _0: -0, + _1: Math.sign(-0) + }; + }) ], tl: { hd: [ "sin", (function (param) { - return { - TAG: "ApproxThreshold", - _0: 0.001, - _1: 0.389, - _2: Math.sin(0.4) - }; - }) + return { + TAG: "ApproxThreshold", + _0: 0.001, + _1: 0.389, + _2: Math.sin(0.4) + }; + }) ], tl: { hd: [ "sinh", (function (param) { - return { - TAG: "ApproxThreshold", - _0: 0.001, - _1: 0.410, - _2: Math.sinh(0.4) - }; - }) + return { + TAG: "ApproxThreshold", + _0: 0.001, + _1: 0.410, + _2: Math.sinh(0.4) + }; + }) ], tl: { hd: [ "sqrt", (function (param) { - return { - TAG: "ApproxThreshold", - _0: 0.001, - _1: 0.632, - _2: Math.sqrt(0.4) - }; - }) + return { + TAG: "ApproxThreshold", + _0: 0.001, + _1: 0.632, + _2: Math.sqrt(0.4) + }; + }) ], tl: { hd: [ "tan", (function (param) { - return { - TAG: "ApproxThreshold", - _0: 0.001, - _1: 0.422, - _2: Math.tan(0.4) - }; - }) + return { + TAG: "ApproxThreshold", + _0: 0.001, + _1: 0.422, + _2: Math.tan(0.4) + }; + }) ], tl: { hd: [ "tanh", (function (param) { - return { - TAG: "ApproxThreshold", - _0: 0.001, - _1: 0.379, - _2: Math.tanh(0.4) - }; - }) + return { + TAG: "ApproxThreshold", + _0: 0.001, + _1: 0.379, + _2: Math.tanh(0.4) + }; + }) ], tl: { hd: [ "unsafe_trunc", (function (param) { + return { + TAG: "Eq", + _0: 4, + _1: Math.trunc(4.2156) + }; + }) + ], + tl: { + hd: [ + "trunc", + (function (param) { return { TAG: "Eq", _0: 4, _1: Math.trunc(4.2156) }; }) - ], - tl: { - hd: [ - "trunc", - (function (param) { - return { - TAG: "Eq", - _0: 4, - _1: Math.trunc(4.2156) - }; - }) ], tl: /* [] */0 } diff --git a/jscomp/test/js_null_test.js b/jscomp/test/js_null_test.js index fc571752d2..1d035ad660 100644 --- a/jscomp/test/js_null_test.js +++ b/jscomp/test/js_null_test.js @@ -8,139 +8,139 @@ var Caml_option = require("../../lib/js/caml_option.js"); var suites_0 = [ "toOption - empty", (function (param) { - return { - TAG: "Eq", - _0: undefined, - _1: undefined - }; - }) + return { + TAG: "Eq", + _0: undefined, + _1: undefined + }; + }) ]; var suites_1 = { hd: [ "toOption - 'a", (function (param) { - return { - TAG: "Eq", - _0: Caml_option.some(undefined), - _1: Caml_option.some() - }; - }) + return { + TAG: "Eq", + _0: Caml_option.some(undefined), + _1: Caml_option.some() + }; + }) ], tl: { hd: [ "return", (function (param) { - return { - TAG: "Eq", - _0: "something", - _1: Caml_option.null_to_opt("something") - }; - }) + return { + TAG: "Eq", + _0: "something", + _1: Caml_option.null_to_opt("something") + }; + }) ], tl: { hd: [ "test - empty", (function (param) { - return { - TAG: "Eq", - _0: true, - _1: true - }; - }) + return { + TAG: "Eq", + _0: true, + _1: true + }; + }) ], tl: { hd: [ "test - 'a", (function (param) { - return { - TAG: "Eq", - _0: false, - _1: false - }; - }) + return { + TAG: "Eq", + _0: false, + _1: false + }; + }) ], tl: { hd: [ "bind - empty", (function (param) { - return { - TAG: "StrictEq", - _0: null, - _1: Js_null.bind(null, (function (v) { - return v; - })) - }; - }) + return { + TAG: "StrictEq", + _0: null, + _1: Js_null.bind(null, (function (v) { + return v; + })) + }; + }) ], tl: { hd: [ "bind - 'a", (function (param) { - return { - TAG: "StrictEq", - _0: 4, - _1: Js_null.bind(2, (function (n) { - return (n << 1); - })) - }; - }) + return { + TAG: "StrictEq", + _0: 4, + _1: Js_null.bind(2, (function (n) { + return (n << 1); + })) + }; + }) ], tl: { hd: [ "iter - empty", (function (param) { + var hit = { + contents: false + }; + Js_null.iter(null, (function (param) { + hit.contents = true; + })); + return { + TAG: "Eq", + _0: false, + _1: hit.contents + }; + }) + ], + tl: { + hd: [ + "iter - 'a", + (function (param) { var hit = { - contents: false + contents: 0 }; - Js_null.iter(null, (function (param) { - hit.contents = true; - })); + Js_null.iter(2, (function (v) { + hit.contents = v; + })); return { TAG: "Eq", - _0: false, + _0: 2, _1: hit.contents }; }) - ], - tl: { - hd: [ - "iter - 'a", - (function (param) { - var hit = { - contents: 0 - }; - Js_null.iter(2, (function (v) { - hit.contents = v; - })); - return { - TAG: "Eq", - _0: 2, - _1: hit.contents - }; - }) ], tl: { hd: [ "fromOption - None", (function (param) { - return { - TAG: "Eq", - _0: null, - _1: Js_null.fromOption(undefined) - }; - }) + return { + TAG: "Eq", + _0: null, + _1: Js_null.fromOption(undefined) + }; + }) ], tl: { hd: [ "fromOption - Some", (function (param) { - return { - TAG: "Eq", - _0: 2, - _1: Js_null.fromOption(2) - }; - }) + return { + TAG: "Eq", + _0: 2, + _1: Js_null.fromOption(2) + }; + }) ], tl: /* [] */0 } diff --git a/jscomp/test/js_null_undefined_test.js b/jscomp/test/js_null_undefined_test.js index c7993e4264..4ffbf1acb1 100644 --- a/jscomp/test/js_null_undefined_test.js +++ b/jscomp/test/js_null_undefined_test.js @@ -8,283 +8,283 @@ var Js_null_undefined = require("../../lib/js/js_null_undefined.js"); var suites_0 = [ "toOption - null", (function (param) { - return { - TAG: "Eq", - _0: undefined, - _1: undefined - }; - }) + return { + TAG: "Eq", + _0: undefined, + _1: undefined + }; + }) ]; var suites_1 = { hd: [ "toOption - undefined", (function (param) { + return { + TAG: "Eq", + _0: undefined, + _1: undefined + }; + }) + ], + tl: { + hd: [ + "toOption - empty", + (function (param) { return { TAG: "Eq", _0: undefined, _1: undefined }; }) - ], - tl: { - hd: [ - "toOption - empty", - (function (param) { - return { - TAG: "Eq", - _0: undefined, - _1: undefined - }; - }) ], tl: { hd: [ "File \"js_null_undefined_test.res\", line 9, characters 5-12", (function (param) { - return { - TAG: "Eq", - _0: "foo", - _1: Caml_option.nullable_to_opt("foo") - }; - }) + return { + TAG: "Eq", + _0: "foo", + _1: Caml_option.nullable_to_opt("foo") + }; + }) ], tl: { hd: [ "return", (function (param) { - return { - TAG: "Eq", - _0: "something", - _1: Caml_option.nullable_to_opt("something") - }; - }) + return { + TAG: "Eq", + _0: "something", + _1: Caml_option.nullable_to_opt("something") + }; + }) ], tl: { hd: [ "test - null", (function (param) { + return { + TAG: "Eq", + _0: true, + _1: true + }; + }) + ], + tl: { + hd: [ + "test - undefined", + (function (param) { return { TAG: "Eq", _0: true, _1: true }; }) - ], - tl: { - hd: [ - "test - undefined", - (function (param) { + ], + tl: { + hd: [ + "test - empty", + (function (param) { return { TAG: "Eq", _0: true, _1: true }; }) - ], - tl: { - hd: [ - "test - empty", - (function (param) { + ], + tl: { + hd: [ + "File \"js_null_undefined_test.res\", line 14, characters 5-12", + (function (param) { return { TAG: "Eq", _0: true, _1: true }; }) - ], - tl: { - hd: [ - "File \"js_null_undefined_test.res\", line 14, characters 5-12", - (function (param) { - return { - TAG: "Eq", - _0: true, - _1: true - }; - }) ], tl: { hd: [ "bind - null", (function (param) { - return { - TAG: "StrictEq", - _0: null, - _1: Js_null_undefined.bind(null, (function (v) { - return v; - })) - }; - }) + return { + TAG: "StrictEq", + _0: null, + _1: Js_null_undefined.bind(null, (function (v) { + return v; + })) + }; + }) ], tl: { hd: [ "bind - undefined", (function (param) { + return { + TAG: "StrictEq", + _0: undefined, + _1: Js_null_undefined.bind(undefined, (function (v) { + return v; + })) + }; + }) + ], + tl: { + hd: [ + "bind - empty", + (function (param) { return { TAG: "StrictEq", _0: undefined, _1: Js_null_undefined.bind(undefined, (function (v) { - return v; - })) + return v; + })) }; }) - ], - tl: { - hd: [ - "bind - empty", - (function (param) { - return { - TAG: "StrictEq", - _0: undefined, - _1: Js_null_undefined.bind(undefined, (function (v) { - return v; - })) - }; - }) ], tl: { hd: [ "bind - 'a", (function (param) { - return { - TAG: "Eq", - _0: 4, - _1: Js_null_undefined.bind(2, (function (n) { - return (n << 1); - })) - }; - }) + return { + TAG: "Eq", + _0: 4, + _1: Js_null_undefined.bind(2, (function (n) { + return (n << 1); + })) + }; + }) ], tl: { hd: [ "iter - null", (function (param) { + var hit = { + contents: false + }; + Js_null_undefined.iter(null, (function (param) { + hit.contents = true; + })); + return { + TAG: "Eq", + _0: false, + _1: hit.contents + }; + }) + ], + tl: { + hd: [ + "iter - undefined", + (function (param) { var hit = { contents: false }; - Js_null_undefined.iter(null, (function (param) { - hit.contents = true; - })); + Js_null_undefined.iter(undefined, (function (param) { + hit.contents = true; + })); return { TAG: "Eq", _0: false, _1: hit.contents }; }) - ], - tl: { - hd: [ - "iter - undefined", - (function (param) { + ], + tl: { + hd: [ + "iter - empty", + (function (param) { var hit = { contents: false }; Js_null_undefined.iter(undefined, (function (param) { - hit.contents = true; - })); + hit.contents = true; + })); return { TAG: "Eq", _0: false, _1: hit.contents }; }) - ], - tl: { - hd: [ - "iter - empty", - (function (param) { + ], + tl: { + hd: [ + "iter - 'a", + (function (param) { var hit = { - contents: false + contents: 0 }; - Js_null_undefined.iter(undefined, (function (param) { - hit.contents = true; - })); + Js_null_undefined.iter(2, (function (v) { + hit.contents = v; + })); return { TAG: "Eq", - _0: false, + _0: 2, _1: hit.contents }; }) - ], - tl: { - hd: [ - "iter - 'a", - (function (param) { - var hit = { - contents: 0 - }; - Js_null_undefined.iter(2, (function (v) { - hit.contents = v; - })); - return { - TAG: "Eq", - _0: 2, - _1: hit.contents - }; - }) ], tl: { hd: [ "fromOption - None", (function (param) { - return { - TAG: "Eq", - _0: undefined, - _1: Js_null_undefined.fromOption(undefined) - }; - }) + return { + TAG: "Eq", + _0: undefined, + _1: Js_null_undefined.fromOption(undefined) + }; + }) ], tl: { hd: [ "fromOption - Some", (function (param) { - return { - TAG: "Eq", - _0: 2, - _1: Js_null_undefined.fromOption(2) - }; - }) + return { + TAG: "Eq", + _0: 2, + _1: Js_null_undefined.fromOption(2) + }; + }) ], tl: { hd: [ "null <> undefined", (function (param) { - return { - TAG: "Ok", - _0: true - }; - }) + return { + TAG: "Ok", + _0: true + }; + }) ], tl: { hd: [ "null <> empty", (function (param) { - return { - TAG: "Ok", - _0: true - }; - }) + return { + TAG: "Ok", + _0: true + }; + }) ], tl: { hd: [ "undefined = empty", (function (param) { - return { - TAG: "Ok", - _0: true - }; - }) + return { + TAG: "Ok", + _0: true + }; + }) ], tl: { hd: [ "File \"js_null_undefined_test.res\", line 57, characters 6-13", (function (param) { - return { - TAG: "Ok", - _0: true - }; - }) + return { + TAG: "Ok", + _0: true + }; + }) ], tl: /* [] */0 } diff --git a/jscomp/test/js_nullable_test.js b/jscomp/test/js_nullable_test.js index a1c2f25dd2..bae3a4ede4 100644 --- a/jscomp/test/js_nullable_test.js +++ b/jscomp/test/js_nullable_test.js @@ -17,12 +17,12 @@ function eq(loc, x, y) { hd: [ loc + (" id " + String(test_id.contents)), (function (param) { - return { - TAG: "Eq", - _0: x, - _1: y - }; - }) + return { + TAG: "Eq", + _0: x, + _1: y + }; + }) ], tl: suites.contents }; diff --git a/jscomp/test/js_obj_test.js b/jscomp/test/js_obj_test.js index ed49b1dcb1..eb5bc3c44d 100644 --- a/jscomp/test/js_obj_test.js +++ b/jscomp/test/js_obj_test.js @@ -6,28 +6,28 @@ var Mt = require("./mt.js"); var suites_0 = [ "empty", (function (param) { - return { - TAG: "Eq", - _0: 0, - _1: Object.keys({}).length - }; - }) + return { + TAG: "Eq", + _0: 0, + _1: Object.keys({}).length + }; + }) ]; var suites_1 = { hd: [ "assign", (function (param) { - return { - TAG: "Eq", - _0: { - a: 1 - }, - _1: Object.assign({}, { - a: 1 - }) - }; - }) + return { + TAG: "Eq", + _0: { + a: 1 + }, + _1: Object.assign({}, { + a: 1 + }) + }; + }) ], tl: /* [] */0 }; diff --git a/jscomp/test/js_option_test.js b/jscomp/test/js_option_test.js index 9e0d20bc4b..bd9519ae5c 100644 --- a/jscomp/test/js_option_test.js +++ b/jscomp/test/js_option_test.js @@ -11,269 +11,269 @@ function simpleEq(a, b) { var option_suites_0 = [ "option_isSome_Some", (function (param) { - return { - TAG: "Eq", - _0: true, - _1: true - }; - }) + return { + TAG: "Eq", + _0: true, + _1: true + }; + }) ]; var option_suites_1 = { hd: [ "option_isSome_None", (function (param) { + return { + TAG: "Eq", + _0: false, + _1: false + }; + }) + ], + tl: { + hd: [ + "option_isNone_Some", + (function (param) { return { TAG: "Eq", _0: false, _1: false }; }) - ], - tl: { - hd: [ - "option_isNone_Some", - (function (param) { - return { - TAG: "Eq", - _0: false, - _1: false - }; - }) ], tl: { hd: [ "option_isNone_None", (function (param) { - return { - TAG: "Eq", - _0: true, - _1: true - }; - }) + return { + TAG: "Eq", + _0: true, + _1: true + }; + }) ], tl: { hd: [ "option_isSomeValue_Eq", (function (param) { - return { - TAG: "Eq", - _0: true, - _1: Js_option.isSomeValue(simpleEq, 2, 2) - }; - }) + return { + TAG: "Eq", + _0: true, + _1: Js_option.isSomeValue(simpleEq, 2, 2) + }; + }) ], tl: { hd: [ "option_isSomeValue_Diff", (function (param) { - return { - TAG: "Eq", - _0: false, - _1: Js_option.isSomeValue(simpleEq, 1, 2) - }; - }) + return { + TAG: "Eq", + _0: false, + _1: Js_option.isSomeValue(simpleEq, 1, 2) + }; + }) ], tl: { hd: [ "option_isSomeValue_DiffNone", (function (param) { - return { - TAG: "Eq", - _0: false, - _1: Js_option.isSomeValue(simpleEq, 1, undefined) - }; - }) + return { + TAG: "Eq", + _0: false, + _1: Js_option.isSomeValue(simpleEq, 1, undefined) + }; + }) ], tl: { hd: [ "option_getExn_Some", (function (param) { - return { - TAG: "Eq", - _0: 2, - _1: Js_option.getExn(2) - }; - }) + return { + TAG: "Eq", + _0: 2, + _1: Js_option.getExn(2) + }; + }) ], tl: { hd: [ "option_equal_Eq", (function (param) { - return { - TAG: "Eq", - _0: true, - _1: Js_option.equal(simpleEq, 2, 2) - }; - }) + return { + TAG: "Eq", + _0: true, + _1: Js_option.equal(simpleEq, 2, 2) + }; + }) ], tl: { hd: [ "option_equal_Diff", (function (param) { - return { - TAG: "Eq", - _0: false, - _1: Js_option.equal(simpleEq, 1, 2) - }; - }) + return { + TAG: "Eq", + _0: false, + _1: Js_option.equal(simpleEq, 1, 2) + }; + }) ], tl: { hd: [ "option_equal_DiffNone", (function (param) { - return { - TAG: "Eq", - _0: false, - _1: Js_option.equal(simpleEq, 1, undefined) - }; - }) + return { + TAG: "Eq", + _0: false, + _1: Js_option.equal(simpleEq, 1, undefined) + }; + }) ], tl: { hd: [ "option_andThen_SomeSome", (function (param) { - return { - TAG: "Eq", - _0: true, - _1: Js_option.isSomeValue(simpleEq, 3, Js_option.andThen((function (a) { - return a + 1 | 0; - }), 2)) - }; - }) + return { + TAG: "Eq", + _0: true, + _1: Js_option.isSomeValue(simpleEq, 3, Js_option.andThen((function (a) { + return a + 1 | 0; + }), 2)) + }; + }) ], tl: { hd: [ "option_andThen_SomeNone", (function (param) { - return { - TAG: "Eq", - _0: false, - _1: Js_option.isSomeValue(simpleEq, 3, Js_option.andThen((function (param) { - - }), 2)) - }; - }) + return { + TAG: "Eq", + _0: false, + _1: Js_option.isSomeValue(simpleEq, 3, Js_option.andThen((function (param) { + + }), 2)) + }; + }) ], tl: { hd: [ "option_map_Some", (function (param) { - return { - TAG: "Eq", - _0: true, - _1: Js_option.isSomeValue(simpleEq, 3, Js_option.map((function (a) { - return a + 1 | 0; - }), 2)) - }; - }) + return { + TAG: "Eq", + _0: true, + _1: Js_option.isSomeValue(simpleEq, 3, Js_option.map((function (a) { + return a + 1 | 0; + }), 2)) + }; + }) ], tl: { hd: [ "option_map_None", (function (param) { - return { - TAG: "Eq", - _0: undefined, - _1: Js_option.map((function (a) { - return a + 1 | 0; - }), undefined) - }; - }) + return { + TAG: "Eq", + _0: undefined, + _1: Js_option.map((function (a) { + return a + 1 | 0; + }), undefined) + }; + }) ], tl: { hd: [ "option_default_Some", (function (param) { - return { - TAG: "Eq", - _0: 2, - _1: Js_option.getWithDefault(3, 2) - }; - }) + return { + TAG: "Eq", + _0: 2, + _1: Js_option.getWithDefault(3, 2) + }; + }) ], tl: { hd: [ "option_default_None", (function (param) { - return { - TAG: "Eq", - _0: 3, - _1: Js_option.getWithDefault(3, undefined) - }; - }) + return { + TAG: "Eq", + _0: 3, + _1: Js_option.getWithDefault(3, undefined) + }; + }) ], tl: { hd: [ "option_filter_Pass", (function (param) { - return { - TAG: "Eq", - _0: true, - _1: Js_option.isSomeValue(simpleEq, 2, Js_option.filter((function (a) { - return a % 2 === 0; - }), 2)) - }; - }) + return { + TAG: "Eq", + _0: true, + _1: Js_option.isSomeValue(simpleEq, 2, Js_option.filter((function (a) { + return a % 2 === 0; + }), 2)) + }; + }) ], tl: { hd: [ "option_filter_Reject", (function (param) { + return { + TAG: "Eq", + _0: undefined, + _1: Js_option.filter((function (a) { + return a % 3 === 0; + }), 2) + }; + }) + ], + tl: { + hd: [ + "option_filter_None", + (function (param) { return { TAG: "Eq", _0: undefined, _1: Js_option.filter((function (a) { - return a % 3 === 0; - }), 2) + return a % 3 === 0; + }), undefined) }; }) - ], - tl: { - hd: [ - "option_filter_None", - (function (param) { - return { - TAG: "Eq", - _0: undefined, - _1: Js_option.filter((function (a) { - return a % 3 === 0; - }), undefined) - }; - }) ], tl: { hd: [ "option_firstSome_First", (function (param) { - return { - TAG: "Eq", - _0: true, - _1: Js_option.isSomeValue(simpleEq, 3, Js_option.firstSome(3, 2)) - }; - }) + return { + TAG: "Eq", + _0: true, + _1: Js_option.isSomeValue(simpleEq, 3, Js_option.firstSome(3, 2)) + }; + }) ], tl: { hd: [ "option_firstSome_First", (function (param) { - return { - TAG: "Eq", - _0: true, - _1: Js_option.isSomeValue(simpleEq, 2, Js_option.firstSome(undefined, 2)) - }; - }) + return { + TAG: "Eq", + _0: true, + _1: Js_option.isSomeValue(simpleEq, 2, Js_option.firstSome(undefined, 2)) + }; + }) ], tl: { hd: [ "option_firstSome_None", (function (param) { - return { - TAG: "Eq", - _0: undefined, - _1: Js_option.firstSome(undefined, undefined) - }; - }) + return { + TAG: "Eq", + _0: undefined, + _1: Js_option.firstSome(undefined, undefined) + }; + }) ], tl: /* [] */0 } diff --git a/jscomp/test/js_re_test.js b/jscomp/test/js_re_test.js index 31ab40bc55..42e43e99c6 100644 --- a/jscomp/test/js_re_test.js +++ b/jscomp/test/js_re_test.js @@ -8,119 +8,139 @@ var Caml_option = require("../../lib/js/caml_option.js"); var suites_0 = [ "captures", (function (param) { - var re = /(\d+)-(?:(\d+))?/g; - var result = re.exec("3-"); - if (result === null) { - return { - TAG: "Fail", - _0: undefined - }; - } - var defined = Caml_array.get(result, 1); - var $$undefined = Caml_array.get(result, 2); + var re = /(\d+)-(?:(\d+))?/g; + var result = re.exec("3-"); + if (result === null) { return { - TAG: "Eq", - _0: [ - "3", - null - ], - _1: [ - defined, - $$undefined - ] + TAG: "Fail", + _0: undefined }; - }) + } + var defined = Caml_array.get(result, 1); + var $$undefined = Caml_array.get(result, 2); + return { + TAG: "Eq", + _0: [ + "3", + null + ], + _1: [ + defined, + $$undefined + ] + }; + }) ]; var suites_1 = { hd: [ "fromString", (function (param) { - var contentOf = function (tag, xmlString) { - var x = new RegExp("<" + (tag + (">(.*?)<\\/" + (tag + ">")))).exec(xmlString); - if (x !== null) { - return Caml_option.nullable_to_opt(Caml_array.get(x, 1)); - } - - }; - return { - TAG: "Eq", - _0: contentOf("div", "