/
githubmirror
/
deno
Обзор
Документация
Войти
/
githubmirror
/
deno
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
main
tests/specs/node/pipe_open_fd/invalid_fd.ts
18 строк
586 B
Felipe Cardozo
feat: support named pipe listen, connect and open (#31624)
19 дек 2025, 11:18
Не верифицирован
19 дек 2025, 11:18
dd47e25
Код
Авторство
О чём код?
// Test Pipe.prototype.open() with invalid fd import { createRequire } from "node:module"; const require = createRequire(import.meta.url); const { Pipe, constants: PipeConstants } = require("internal/test/binding") .internalBinding("pipe_wrap"); const pipe = new Pipe(PipeConstants.SOCKET); const result = pipe.open(-1); // Should return a non-zero error code for invalid fd console.log(`open(-1) returned: ${result}`); if (result !== 0) { console.log("PASS: Invalid fd returns error code"); } else { console.log("FAIL: Invalid fd should return error code"); Deno.exit(1); }