test(core): cite the rule that states the fact, and assert the fact, not the wording
Review of V-D2's tests: - S-E3's vocabulary: `item k` and `INVARIANT k` become `invariant k` of WB-ledger-15, WB-ledger-9 (no numbered parts: cited whole), and the statements and invariants of BS-arap-5 and BS-arap-6 that the tests actually pin. - The split-group tests cite WB-entry-6, the only rule that says "as part of a split group", not BS-entry-5. - A refusal is pinned by its variant plus the fragment that states the fact (a figure, "positive", "strictly greater"), not its whole sentence; the `ConventionKind::ALL.len() == 7` pin is dropped. - `a_send...moves_no_figure` compared receivables with itself; it now asserts the bank unchanged and receivables at 500.00. - The disposal test says a day before the asset was acquired is refused and now asserts DisposalBeforeAcquisition. - Main's FeeAboveCash variant replaces the InvalidSettlement text the fee test matched; it now asserts the variant and both figures. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
7ac1ef8c5a
commit
344e09933d
5 files changed
+59
-37
No files matched your search
@@ -298,6 +298,11 @@ fn a_disposal_is_refused_unless_the_asset_is_active_and_the_proceeds_make_sense(
|
||||
refused(&mut l, |l| l.dispose_asset(id, d(6, 1), usd("-1.00"))),
|
||||
LedgerError::NegativeProceeds(dec("-1.00"))
|
||||
);
|
||||
// The laptop went into service on 1/15: a day before that is refused.
|
||||
assert!(matches!(
|
||||
refused(&mut l, |l| l.dispose_asset(id, d(1, 14), usd("1.00"))),
|
||||
LedgerError::DisposalBeforeAcquisition { .. }
|
||||
));
|
||||
l.dispose_asset(id, d(6, 1), usd("700.00")).unwrap();
|
||||
assert_eq!(
|
||||
refused(&mut l, |l| l.dispose_asset(id, d(7, 1), usd("1.00"))),
|
||||
@@ -364,7 +369,7 @@ fn the_fiscal_year_does_not_move_under_a_closed_period() {
|
||||
|
||||
// ---------------------------------------------------------------- evidence on the ledger
|
||||
|
||||
/// WB-ledger-15 item 4 and 5: annotations are checked as `Annotation::
|
||||
/// WB-ledger-15 invariants 4 and 5: annotations are checked as `Annotation::
|
||||
/// checked` says before they are kept; a second annotation of the same file
|
||||
/// replaces the first; receipt numbers run from the highest annotated, so a
|
||||
/// human's duplicate is not renumbered.
|
||||
@@ -420,7 +425,7 @@ fn annotations_replace_by_file_and_receipt_numbers_run_from_the_max() {
|
||||
assert_eq!(l.next_receipt_number(), u32::MAX, "saturates, never wraps");
|
||||
}
|
||||
|
||||
/// WB-ledger-15 item 5: `entry.settles` names entries that exist, never
|
||||
/// WB-ledger-15 invariant 5: `entry.settles` names entries that exist, never
|
||||
/// the entry itself, never one twice; "reimbursed" is derived from it
|
||||
/// alone; a refusal changes nothing.
|
||||
#[test]
|
||||
|
||||
Reference in new issue
Block a user