diff options
Diffstat (limited to 'cli/tests/unit/signal_test.ts')
-rw-r--r-- | cli/tests/unit/signal_test.ts | 34 |
1 files changed, 34 insertions, 0 deletions
diff --git a/cli/tests/unit/signal_test.ts b/cli/tests/unit/signal_test.ts index 31562c99a..b67dc9668 100644 --- a/cli/tests/unit/signal_test.ts +++ b/cli/tests/unit/signal_test.ts @@ -203,3 +203,37 @@ Deno.test( }); }, ); + +Deno.test( + { + ignore: Deno.build.os === "windows", + permissions: { run: true }, + }, + function signalForbiddenSignalTest() { + assertThrows( + () => Deno.addSignalListener("SIGKILL", () => {}), + TypeError, + "Binding to signal 'SIGKILL' is not allowed", + ); + assertThrows( + () => Deno.addSignalListener("SIGSTOP", () => {}), + TypeError, + "Binding to signal 'SIGSTOP' is not allowed", + ); + assertThrows( + () => Deno.addSignalListener("SIGILL", () => {}), + TypeError, + "Binding to signal 'SIGILL' is not allowed", + ); + assertThrows( + () => Deno.addSignalListener("SIGFPE", () => {}), + TypeError, + "Binding to signal 'SIGFPE' is not allowed", + ); + assertThrows( + () => Deno.addSignalListener("SIGSEGV", () => {}), + TypeError, + "Binding to signal 'SIGSEGV' is not allowed", + ); + }, +); |