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>
This commit is contained in:
1 parent
66d9b7ac54
commit
f9cdf4d718
24 files changed
+4764
-4663
No files matched your search
@@ -0,0 +1,26 @@
|
||||
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"
|
||||
);
|
||||
}
|
||||
Reference in new issue
Block a user