Files
wanderbooks/crates/ledger-core/tests/bookspec/rules_md.rs
T
swaitsandDeepSeek V4.1 Flash f9cdf4d718 refactor(core): the bookspec adapter becomes modules by area
The bookspec adapter was one 4,647-line test file, and every later unit
that adds a query or an event touches it. Split it by its own sections,
with no behaviour change: `main` keeps the crate doc, the shared imports
and the module list; `common` holds the shared vocabulary (dates,
refusals, exact decimals, figure formatting); `books` the example's
books and setup; `events` the application of each event; `queries/` the
answers and checks per query family (statements, parties, tax, assets,
formats, commands, dates); `engine` the `Engine` impl; `check` and `run`
the drivers; and `examples`, `loader_tests`, `sources` and `rules_md`
the tests by area. Every `#[test]` keeps its function name (52 tests,
same names), and Cargo still builds one test target named `bookspec`.

Co-Authored-By: DeepSeek V4.1 Flash <noreply@opencode.ai>
2026-11-08 10:49:03 -07:00

27 lines
740 B
Rust

use crate::*;
/// `docs/spec/rules.md` carries every stated rule's id under its heading,
/// and no longer calls a choice a decision (P13 step 3).
#[test]
pub(crate) fn rules_md_carries_every_id() {
let text = std::fs::read_to_string(
Path::new(env!("CARGO_MANIFEST_DIR")).join("../../docs/spec/rules.md"),
)
.expect("docs/spec/rules.md");
for rule in bookspec_checker::rules()
.iter()
.filter(|r| r.status.is_some())
{
assert!(
text.contains(&format!("**bookspec:** `{}`", rule.id)),
"B-{} carries {}",
rule.b,
rule.id
);
}
assert!(
!text.contains("DECISION"),
"rules.md speaks bookspec's CHOICE"
);
}