don't compile _testAwaitLet off js

This commit is contained in:
2023-02-18 16:03:46 -07:00
parent 8dd6f1578c
commit c5002c48bc

View File

@@ -772,40 +772,41 @@ From:[(assert false (+ \"false \" \"should \" \"have \" \"been \" \"true\"))]" m
(Assert.equals "a55.5true" "${a}${five}${fivePointFive}${tt}")) (Assert.equals "a55.5true" "${a}${five}${fivePointFive}${tt}"))
(never otherwise))) (never otherwise)))
(function _testAwaitLet [:utest.Async async] (#when js
(localFunction :Promise<Bool> newPromise [:Bool succeed] (function _testAwaitLet [:utest.Async async]
(new Promise (localFunction :Promise<Bool> newPromise [:Bool succeed]
->:Void [ (new Promise
:Bool->Void resolve ->:Void [
:Dynamic->Void reject :Bool->Void resolve
] (if succeed (resolve true) (reject false)))) :Dynamic->Void reject
] (if succeed (resolve true) (reject false))))
(awaitLet [result (newPromise true)]
(catch [:Dynamic e] (Assert.fail)) (awaitLet [result (newPromise true)]
(Assert.isTrue result) (catch [:Dynamic e] (Assert.fail))
(awaitLet [res1 (newPromise false) (Assert.isTrue result)
res2 (newPromise true) (awaitLet [res1 (newPromise false)
res3 (newPromise true)] res2 (newPromise true)
(catch [:Dynamic e] res3 (newPromise true)]
(Assert.isFalse e) (catch [:Dynamic e]
(awaitLet [res1 (newPromise true) (Assert.isFalse e)
res2 (newPromise false) (awaitLet [res1 (newPromise true)
res3 (newPromise true)] res2 (newPromise false)
(catch [:Dynamic e] res3 (newPromise true)]
(Assert.isFalse e) (catch [:Dynamic e]
(awaitLet [res1 (newPromise true) (Assert.isFalse e)
res2 (newPromise true) (awaitLet [res1 (newPromise true)
res3 (newPromise false)] res2 (newPromise true)
(catch [:Dynamic e] res3 (newPromise false)]
(Assert.isFalse e) (catch [:Dynamic e]
(awaitLet [res1 (newPromise true) (Assert.isFalse e)
res2 (newPromise res1) (awaitLet [res1 (newPromise true)
res3 (newPromise res2)] res2 (newPromise res1)
(Assert.isTrue ?(and res1 res2 res3)) res3 (newPromise res2)]
(async.done)) (Assert.isTrue ?(and res1 res2 res3))
e) (async.done))
(Assert.fail)) e)
e) (Assert.fail))
(Assert.fail)) e)
e) (Assert.fail))
(Assert.fail)))) e)
(Assert.fail)))))