test(core): the adapter runs schedules that take the pick, settings, role accounts, tax summaries and an export's line ending

A schedule may now leave its convention to the engine, so an example can
show BS-prepaid-2's pick: the adapter registers such a schedule by the
day, wanderbooks' method (D-11, D-37), and the equal-months examples are
skipped as the runner skips another engine's option. The yen examples run
through `Store::register_schedule`, whose `schedule_minor_unit` feature
rounds a monthly-even month to the currency's minor unit (D-72, K-U5);
`answer_schedule_plan` now prints each month as the plan holds it, so a
yen month is 333 and not 333.00.

The new events and queries go through the engine's own commands, never a
reimplementation: `set_setting` is `Store::change_settings` with its
`Source` (who decided and when), the setting query reads
`Ledger::settings`, the role account query reads `Ledger::role_account`,
the tax summary is `tax::tax_summary`'s once-rounded lines, and the line
ending is the `ledger_import` file's own CR LF. The BS-format-9 example
uses an entry posted as an earlier version wrote it, so its memo is the
example's and no document's wording stands between the file and the
check. The skip count moves from 16 to 22, the six new unpicked-option
examples (the cent rule, the file's place, one fiscal year, closes
written, the platform line ending and per-account rounding).

Co-Authored-By: DeepSeek V4.1 Flash <noreply@opencode.ai>
This commit is contained in:
swaitsandDeepSeek V4.1 Flash committed 2026-11-09 10:49:44 -07:00
1 parent 01acb159f0
commit 688ab951d3
9 files changed
+227 -21

No files matched your search

+16 -10
View File
@@ -126,6 +126,10 @@ pub(crate) fn every_bookspec_example_holds() {
("party_tin_last4", 5),
("iif_lines", 1),
("iif_changes", 1),
("iif_line_ending", 1),
("setting", 1),
("role_account", 1),
("tax_summary", 1),
("period", 6),
("day", 1),
("calendar_year", 1),
@@ -162,17 +166,19 @@ pub(crate) fn every_bookspec_example_holds() {
// of BS-arap-2 (documents-kept-apart), -7, -8, -9, -10 (compare-exactly),
// -11 (recovery-movement), -12 (net-of-expected-discount), -13
// (net-against-the-deposit) and -14 (apportion-across-the-lines),
// BS-prepaid-2's equal-months and BS-ledger-20's refuse (each option's
// example, so no allow-list grows), BS-entry-6's check-only-when-posting
// and BS-ledger-17's reversal-needs-its-own (wanderbooks refuses a line on
// a header as it is added, and a reversal needs no evidence of its own),
// and BS-period-4's allow-partial-overlap, BS-1099-2's
// carry-the-last-amount and BS-partner-8's nowhere (wanderbooks nests
// periods, refuses a year whose threshold it does not know, and keeps
// the full TIN outside the books).
// BS-prepaid-2's equal-months, BS-prepaid-4's cent rule and BS-ledger-20's
// refuse (each option's example, so no allow-list grows), BS-entry-6's
// check-only-when-posting and BS-ledger-17's reversal-needs-its-own
// (wanderbooks refuses a line on a header as it is added, and a reversal
// needs no evidence of its own), BS-format-5's file place, -6's one
// fiscal year, -8's closes-written and -4's platform line ending,
// BS-ledger-21's round-per-account, BS-period-4's allow-partial-overlap,
// BS-1099-2's carry-the-last-amount and BS-partner-8's nowhere
// (wanderbooks nests periods, refuses a year whose threshold it does not
// know, and keeps the full TIN outside the books).
assert_eq!(
skipped.len(),
16,
"the sixteen unpicked-option examples: {skipped:?}"
22,
"the twenty-two unpicked-option examples: {skipped:?}"
);
}