/** * `grep --test`: ripgrep over the files one recorded test entered, each * matching line marked by whether the test ran it. * * The recording owns which regions the test entered; ripgrep owns the text. * The files searched are the modules the test entered at least one region of, * so a file it only loaded, a file it never reached and a file no recording * instruments are not searched. Each line is classified by sense's `passedAt`: * ran when an innermost region holding it was entered, or not taken in the * outermost region holding it that the test did not enter. * * The regions are spans of the commit the recording ran at. A file edited since * is read through git's diff against that commit, as `journeys` reads a line: a * hit is classified where its line stood then, and a line written since is * listed apart, since no recording made there can have run it. */ import { type RanRegion, type TestRan } from '@variance-authority/sense'; import { type Page, type Spelling } from '@variance-authority/mcp/tools'; import { type Hit } from './ripgrep.js'; /** One suite's matching lines, split by whether the test ran them. */ interface Marked { readonly suite?: string; readonly ran: TestRan; readonly taken: readonly Hit[]; /** Each with the outermost region holding it that the test did not enter, and whether the rest of its line ran. */ readonly passed: readonly { readonly hit: Hit; readonly by: RanRegion; readonly partly: boolean; }[]; /** Lines written since the recorded commit. */ readonly written: readonly Hit[]; /** A file read through its diff against the recorded commit, or that git could not diff. */ readonly notes: readonly string[]; readonly errors: readonly string[]; } /** The suites that hold the test `file` and `name` choose, and why each other suite does not. */ export interface GrepRan { readonly answered: readonly Marked[]; readonly refused: readonly string[]; } /** `suite x: ` before a suite's answer, nothing for the one suite a recording names no name for. */ export declare const ofSuite: (suite: string | undefined) => string; /** Each suite's matching lines for the chosen test, or the refusals when no suite holds it. */ export declare function grepRan(root: string, query: string, file: string, name: string | undefined): GrepRan; /** * The answer, ran lines first, then the lines in regions the test passed by. * Each suite's lines are one ordered list, so `page` counts across its * sections, and every suite shows the same rows of its own list. */ export declare function formatGrepRan(query: string, { answered, refused }: GrepRan, page: Page, spell: Spelling): string; export {}; //# sourceMappingURL=grep-ran.d.ts.map