1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
// Copyright (c) 2026 tabnas, MIT License
//! Shared test-support utilities for the tabnas parser system.
//!
//! Every tabnas package ships a canonical TypeScript implementation and
//! ports of it, and proves they agree by running **one** set of TSV
//! fixtures from `test/spec/` in every runtime. This crate is the
//! machinery that reads those fixtures in Rust, so there is one loader
//! with one set of rules instead of a copy per repository quietly
//! drifting from its TypeScript and Go twins.
//!
//! The TypeScript half is `@tabnas/support` and the Go half is
//! `github.com/tabnas/support/go`. The three are written to behave
//! identically: same escape codec, same comment and blank-line handling,
//! same `ERROR:<code>` contract, same value comparison. Where a
//! difference is unavoidable it is documented at the point it appears,
//! and collected in `doc/reference.md`.
//!
//! A typical suite is a few lines:
//!
//! ```no_run
//! use tabnas_support::{find_spec_dir, Failure, Runner, Value};
//!
//! let dir = find_spec_dir(None).expect("a test/spec directory above the crate");
//! Runner::new(|input| {
//! // Parse with your grammar, then hand back a `Value` or a `Failure`
//! // carrying the error code the fixture pins.
//! let _ = input;
//! Err(Failure::new("unexpected"))
//! })
//! .dir(dir.join("happy"));
//! ```
//!
//! This crate has **no required dependencies**, and never will: every
//! tabnas Rust crate would take it as a dev-dependency, so anything it
//! required would land in all of them. The adder grammar that exercises
//! it end to end therefore lives in the separate `adder/` crate, which
//! may depend on the engine.
use fmt;
/// The release version, kept in step with `ts/package.json`. See
/// `tests/version_test.rs`, which fails the build when they drift.
pub const VERSION: &str = "0.3.7";
pub use ;
pub use ;
pub use ;
pub use ;
pub use ;
pub use ;
pub use Value;
/// A defect in a fixture, a suite or a runner: an unreadable file, a
/// malformed expectation, a runner built without a parser. Carries the
/// same sentence the TypeScript and Go halves raise for the same
/// condition, so a failure reads the same whichever runtime reported it.
;
/// The result type every fallible function here returns.
pub type Result<T> = Result;