IF Commons GitHub

logical/conformance/mod

Written to: 2 requirements: 2 proved, 0 partly, 0 failing, 0 with no test recorded. 0005-anyfs-conformance FR-001, 0005-anyfs-conformance FR-002

The conformance suite of AnyFS: the cases every backend passes, each needing named capabilities, and the functions that choose and run them. A backend's tests call runConformance with a function that makes a new, empty store, and the suite runs every case whose needs the store has and says which failed and how.

import { runConformance } from "./mod.ts";
// const report = await runConformance(async () => memoryStore())
// report.filter((r) => r.failure !== undefined) // the cases that failed

Source: commons/anyfs/src/logical/conformance/mod.ts

4 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.

MODEL_SEEDSconstno test imports it
const MODEL_SEEDS: readonly [1, 2, 3]

The seeds of the model cases the suite runs.

MODEL_STEPSconstno test imports it
const MODEL_STEPS: 300

The operations of each model case.

ALL_CASESconst
const ALL_CASES: readonly Case[]

Every case of the suite, the model cases included.

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

casesForfunction
function casesFor(capabilities: Iterable<"append" | "batch" | "cas" | "delete" | "history" | "list" | "lock" | "merge" | "rangeRead" | "read" | "rename" | "search" | "stat" | "watch" | "write">): readonly Case[]

The cases a store with these capabilities is held to: those whose needs it has.

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

CaseReporttypeno test imports it
type CaseReport = { readonly id: string; readonly title: string; readonly failure?: string };

What one case did.

runCasefunction
function runCase(c: Case, make: Make): Promise<CaseReport>

Runs one case against stores made by make: its report, with the failure as a sentence.

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

runConformancefunction
function runConformance(make: () => Promise<Store<"delete" | "list" | "read" | "stat" | "write">>): Promise<readonly CaseReport[]>

Runs every case the stores made by make are held to, and reports each.

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

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