Crate cctr_corpus

Crate cctr_corpus 

Source
Expand description

Corpus test file parser.

Parses .txt corpus test files into structured test cases using winnow.

§File Format

===
test name
===
command to run
---
expected output

===
test with variables
===
some_command
---
Completed in {{ time: number }}s
---
where
* time > 0
* time < 60

Types can be specified inline in placeholders: {{ x }}, {{ x: number }}, {{ x:string }}, {{ x : json object }}. If no type is given, the type is inferred from the matched value using duck-typing.

Structs§

TestCase
A single test case parsed from a corpus file.
Variable
A declared variable with name and optional type (None means duck-typed).

Enums§

ParseError
Segment
A segment of a template string - either literal text or a placeholder.
VarType
Variable type for pattern matching.

Functions§

parse_content
parse_file
parse_segments