The bookspec examples now spell the input an engine has to refuse, and the adapter takes each through the real books: - a date past 9999 is refused by `Store::create_entry`'s own `try_create_entry` (DateOutOfRange), and a line past one quadrillion by `add_line` (AmountOutOfRange), each on a rehearsal so a refused entry leaves no draft; - a close whose period partly overlaps another creates it through `Store::create_period` and reads PeriodsOverlap; - `assign_role` is `Store::assign_role`, the journaled command, so a role on a header is refused by `check_assign_role` (ControlAccountMismatch) and the chart stays as it was; - an IIF export with an entry on a receivable and a payable account is refused with BS-format-10's word, which is why `export_iif` keeps its typed error; - a 2027 worksheet is refused through `RuleNotKnown` as `unknown_1099_year`, never guessed; - `return_tin` reads the full number from the real `ledger_vault::Vault` the example's `setup.vault_tins` fills, and the books' own record keeps only the last four. The adapter skips sixteen examples now (three more, each for an option wanderbooks did not pick): allow-partial-overlap, carry-the-last-amount and nowhere. Every one of the 95 it runs passes. Co-Authored-By: DeepSeek V4.1 Flash <noreply@opencode.ai>
47 lines
1.7 KiB
TOML
47 lines
1.7 KiB
TOML
[package]
|
|
name = "ledger-core"
|
|
version = "0.1.0"
|
|
edition.workspace = true
|
|
license.workspace = true
|
|
repository.workspace = true
|
|
description = "Canonical double-entry bookkeeping semantics: the engine everything else is built on."
|
|
|
|
[dependencies]
|
|
rust_decimal = { version = "1", features = ["serde"] }
|
|
thiserror = "2"
|
|
chrono = { version = "0.4", features = ["serde"] }
|
|
serde = { version = "1", features = ["derive"] }
|
|
serde_json = "1"
|
|
# company.timezone: IANA names, with the zone database built in so every
|
|
# computer reads a name the same way.
|
|
jiff = { version = "0.2.35", default-features = false, features = ["std", "tz-system", "tzdb-bundle-always"] }
|
|
|
|
[lints]
|
|
workspace = true
|
|
|
|
[dev-dependencies]
|
|
criterion = "0.8.2"
|
|
proptest = "1"
|
|
# `tests/decimal_exact.rs`: an independent exact reference (arbitrary
|
|
# precision rationals) for `Decimal`, the one numeric type the money paths
|
|
# trust. Test-only, like every dev-dependency here.
|
|
num-bigint = "0.4"
|
|
num-rational = "0.4"
|
|
# bookspec examples are TOML (tests/bookspec/), run on the engine's own
|
|
# store (a dev-dependency only: the store depends on this crate), each in
|
|
# a directory of its own.
|
|
toml = "1"
|
|
# The specification lives in its own repository (P13 step 6, D-34, D-65),
|
|
# pinned to a commit.
|
|
bookspec-checker = { git = "https://git.swaits.com/swaits/bookspec", rev = "2b3b6c904781efc3f9ead71998a61f01efdeeadd" }
|
|
bookspec-runner = { git = "https://git.swaits.com/swaits/bookspec", rev = "2b3b6c904781efc3f9ead71998a61f01efdeeadd" }
|
|
ledger-package = { path = "../ledger-package" }
|
|
ledger-import = { path = "../ledger-import" }
|
|
ledger-store = { path = "../ledger-store" }
|
|
ledger-vault = { path = "../ledger-vault" }
|
|
tempfile = "3"
|
|
|
|
[[bench]]
|
|
name = "books"
|
|
harness = false
|