Skip to main content

Crate korek_testkit

Crate korek_testkit 

Source
Expand description

Shared validation vectors (vectors/rules.json): for each case, a type, a validate block, and values every target must accept or reject. The same table runs against the loader (as examples), the generated Rust (this crate’s tests), the generated Zod (ts/vectors.test.ts) and, through run, any third-party generator.

Modules§

synthetic
A large synthetic schema for benchmarks: modules groups of five types (an enum, two structs, a tagged and an untagged union) whose unions chain into the previous group’s (20 deep), heavy validation on every field, keys blocks of ten keys, and services.

Structs§

Case
One vector.
Mismatch
A mismatch: a value accepted that should fail, or the reverse.

Constants§

VECTORS
The vectors file.

Functions§

cases
Every case.
run
Runs every vector through accepts(case, value) (whether the target accepts {"v": value} for the case’s struct) and returns mismatches.
schema
A korek schema with one struct per case (struct VMinLen { field v … }).
struct_name
min_len → VMinLen: the struct holding a case’s field v.