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