IF Commons GitHub

logical/trail

Written to: 2 requirements: 2 proved, 0 partly, 0 failing, 0 with no test recorded. 0003-anyfs-cli-logical FR-008, 0003-anyfs-cli-logical FR-009

What a verb says of how it did its work (commons anyfs-cli 0003-anyfs-cli-logical FR-008, FR-009): every operation of the POSIX view of a store ends with its fidelity (native, emulated with a risk, or refused), and a verb keeps each in a trail. At the end the trail is a verdict: with --strict any operation that the library carried out by a means that can lose or change what was meant is a problem (E-STRICT), and with -v the emulations are written as lines so that nothing is pretended silently.

import { newTrail } from "./trail.ts";
const trail = newTrail();
trail.steps.length; // 0

Source: commons/anyfs-cli/src/logical/trail.ts

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

Steptypeno test imports it
type Step = { readonly op: string; readonly path: string; readonly fidelity: Fidelity; readonly notes: readonly string[] };

One step: the operation, the path it was about, and how it was carried out.

Trailtypeno test imports it
type Trail = { readonly steps: Step[] };

The steps of a verb, in order.

newTrailfunction
function newTrail(): Trail

An empty trail.

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

describeFailurefunction
function describeFailure(e: PosixError): string

A failed operation as a sentence: its errno in words, the path and what the store said.

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

keepfunction
function keep<T>(trail: Trail, op: string, path: string, done: Result<Outcome<T>, PosixError>): Result<T, PosixError>

Keeps the fidelity of an operation, and gives its value, or the error it ended with.

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

strictViolationsfunction
function strictViolations(trail: Trail): readonly Step[]

The steps a program that asks for strictness stops at.

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

emulatedLinesfunction
function emulatedLines(trail: Trail): readonly string[]

The steps that were not native, once each (an operation on many files is one line), in the order met.

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

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