2024-01-01 14:58:21 -05:00
|
|
|
// Copyright 2018-2024 the Deno authors. All rights reserved. MIT license.
|
2023-01-13 15:51:32 +08:00
|
|
|
|
2022-03-12 01:18:49 +09:00
|
|
|
import { assertNotEquals, execCode } from "./test_util.ts";
|
|
|
|
|
2023-11-09 13:57:26 -07:00
|
|
|
Deno.test("[unrefOpPromise] unref'ing invalid ops does not have effects", async () => {
|
2022-03-12 01:18:49 +09:00
|
|
|
const [statusCode, _] = await execCode(`
|
2023-11-09 13:57:26 -07:00
|
|
|
Deno[Deno.internal].core.unrefOpPromise(new Promise(r => null));
|
2022-03-12 01:18:49 +09:00
|
|
|
setTimeout(() => { throw new Error() }, 10)
|
|
|
|
`);
|
2023-11-09 13:57:26 -07:00
|
|
|
// Invalid unrefOpPromise call doesn't affect exit condition of event loop
|
2022-03-12 01:18:49 +09:00
|
|
|
assertNotEquals(statusCode, 0);
|
|
|
|
});
|