From 504adfc5db695a5b12aa2e3cedb3ad3cfd69518a Mon Sep 17 00:00:00 2001 From: Woonki Moon Date: Sun, 9 Oct 2022 19:01:08 +0900 Subject: [PATCH] fix test --- jscomp/test/Import.js | 12 ++++++++++-- jscomp/test/Import.res | 4 ++-- 2 files changed, 12 insertions(+), 4 deletions(-) diff --git a/jscomp/test/Import.js b/jscomp/test/Import.js index 55dbe28a3a..daf9758f0b 100644 --- a/jscomp/test/Import.js +++ b/jscomp/test/Import.js @@ -6,14 +6,22 @@ var each = import("../../lib/js/belt_List.js").then(function (m) { return m.forEach; }); +function eachInt(list, f) { + var arg1 = function (each) { + return Promise.resolve(Curry._2(each, list, f)); + }; + return each.then(arg1); +} + var beltAsModule = import("../../lib/js/belt_List.js"); -async function eachInt(list, f) { +async function eachIntAsync(list, f) { var each$1 = await each; return Curry._2(each$1, list, f); } exports.each = each; -exports.beltAsModule = beltAsModule; exports.eachInt = eachInt; +exports.beltAsModule = beltAsModule; +exports.eachIntAsync = eachIntAsync; /* No side effect */ diff --git a/jscomp/test/Import.res b/jscomp/test/Import.res index 5d35187ab5..fefe3191a9 100644 --- a/jscomp/test/Import.res +++ b/jscomp/test/Import.res @@ -7,12 +7,12 @@ module type BeltList = module type of Belt.List let beltAsModule = Js.import(module(Belt.List: BeltList)) -let eachInt = async (list: list, f: int => unit) => { +let eachIntAsync = async (list: list, f: int => unit) => { let each = await each list->each(f) } let eachLazy = () => Js.import(Belt.List.forEach) -let eachInt = (list: list, f: int => unit) => +let eachIntLazy = (list: list, f: int => unit) => eachLazy() |> Js.Promise.then_(each => list->each(f)->Js.Promise.resolve)