IF Commons GitHub

physical/runner

Written to: 1 requirement: 1 proved, 0 partly, 0 failing, 0 with no test recorded. 0004-package-managers-dialect FR-004

The runner: a program asked something under a limit of time, answering with its exit status and what it printed, or nothing where it could not be run (no such program, a hang). A program that has started others that keep its output open still answers at the limit and never holds the caller.

import { runWithin } from "./runner.ts";
await runWithin(5000)(["dpkg-query", "-W", "git"]); // { status: 0, stdout: "..." } or undefined

Source: commons/package-managers/src/physical/runner.ts

1 of 3 exports are imported by a test of the run. A test that imports an export may not call it or check what it returns.

Saidtypeno test imports it
type Said = { readonly status: number; readonly stdout: string };

What a program said.

Runtypeno test imports it
type Run = (argv: readonly string[]) => Promise<Said | undefined>;

Runs a command line and says what it said, or nothing where it could not be run.

runWithinfunction
function runWithin(ms: number): Run

A Run that gives a program ms milliseconds and then stops it.

Imported by 7 tests of the run (7 passed, 0 failed): the library's results

Titles, headings, exports, tables, columns and requirements. Esc closes.