Skip to content

Commit 06090db

Browse files
committed
fix test
1 parent 7a3ad03 commit 06090db

File tree

2 files changed

+9
-4
lines changed

2 files changed

+9
-4
lines changed

tests/docstrings_examples/DocTest.res

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -308,6 +308,7 @@ let main = async () => {
308308
// Ignore Js modules and RescriptTools for now
309309
->Array.filter(f => !String.startsWith(f, "Js") && !String.startsWith(f, "RescriptTools"))
310310
->Array.filter(f => f->String.endsWith(".res") || f->String.endsWith(".resi"))
311+
// ->Array.filter(f => f === "String.resi")
311312
->Array.reduce([], (acc, cur) => {
312313
let isInterface = cur->String.endsWith(".resi")
313314

@@ -327,8 +328,12 @@ let main = async () => {
327328

328329
let batchSize = OS.cpus()->Array.length
329330

331+
// Console.log2("module length", modules->Array.length)
330332
let chuncks = modules->chunkArray(batchSize)
331333

334+
// Console.log2("chuncks length", chuncks->Array.length)
335+
// Console.log2("chunck part size", chuncks->Array.map(f => f->Array.length))
336+
332337
let context = ref(0)
333338

334339
let asyncIterator = AsyncIterator.make(async () => {
@@ -338,7 +343,7 @@ let main = async () => {
338343

339344
{
340345
AsyncIterator.value: Some(currentValue),
341-
done: currentValue == Array.length(chuncks) - 1,
346+
done: currentValue == Array.length(chuncks) - 1
342347
}
343348
})
344349

@@ -360,6 +365,7 @@ let main = async () => {
360365
// | None => ()
361366
// }
362367
// )
368+
363369
let processMyAsyncIterator = async () => {
364370
// ReScript doesn't have `for ... of` loops, but it's easy to mimic using a while loop.
365371
let break = ref(false)
@@ -375,7 +381,6 @@ let main = async () => {
375381
switch value {
376382
| Some(index) =>
377383
let c = Array.getUnsafe(chuncks, index)
378-
379384
let a =
380385
await c
381386
->Array.map(async example => {
@@ -393,7 +398,7 @@ let main = async () => {
393398
}
394399
}
395400

396-
processMyAsyncIterator()->ignore
401+
let () = await processMyAsyncIterator()
397402

398403
let compilationResults = result->Array.flat
399404

tests/docstrings_examples/DocTest.res.mjs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -401,7 +401,7 @@ async function main() {
401401

402402
};
403403
};
404-
processMyAsyncIterator();
404+
await processMyAsyncIterator();
405405
let compilationResults = result.flat();
406406
let match = $$Array.reduce(compilationResults, [
407407
[],

0 commit comments

Comments
 (0)