/
githubmirror
/
deno
Обзор
Документация
Войти
/
githubmirror
/
deno
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
main
libs/core_testing/unit/task_test.ts
42 строки
971 B
Bartek Iwańczuk
chore: merge deno_core repo into main repo (#32353)
27 фев 2026, 21:25
Не верифицирован
27 фев 2026, 21:25
ad52a9f
Код
Авторство
О чём код?
// Copyright 2018-2026 the Deno authors. MIT license. import { test } from "checkin:testing"; const { op_task_submit } = Deno.core.ops; test(async function testTaskSubmit1() { const { promise, resolve } = Promise.withResolvers(); op_task_submit(() => { resolve(undefined); }); await promise; }); test(async function testTaskSubmit2() { for (let i = 0; i < 2; i++) { const { promise, resolve } = Promise.withResolvers(); op_task_submit(() => { resolve(undefined); }); await promise; } }); test(async function testTaskSubmit3() { for (let i = 0; i < 3; i++) { const { promise, resolve } = Promise.withResolvers(); op_task_submit(() => { resolve(undefined); }); await promise; } }); test(async function testTaskSubmit100() { for (let i = 0; i < 100; i++) { const { promise, resolve } = Promise.withResolvers(); op_task_submit(() => { resolve(undefined); }); await promise; } });