test(core): the deductible share's Decimal path against an exact reference

No committed test exercised decimal percents or sub-cent books: Kani proves the integer shape, the bridge used 2-decimal books and integer percents, and the tax tests use integer percents. Add deductible_amount_matches_exact_reference_on_decimal_shares, over books at 0-6 decimal places and percents in hundredths 0.00-100.00 (half at 4 places), several shares per category, against an independent reference computed as an exact i128 scaled numerator over a power of ten, rounded half away from zero by integer arithmetic. Pin the review's unit table (ties, sub-cent and FX-precision books, a 6-decimal percent, the Finding 1 regression, and a genuinely unrepresentable quotient) in kernel_bridge, and cover the negative half-cent tie (exact % 100 == -50) in the slow deductible_amount_rounds_once harness, whose Rust % only fired the existing cover for a positive tie.

Co-Authored-By: Muse Wonder 1.0
This commit is contained in:
swaitsandMuse Wonder 1.0 committed 2026-11-08 06:41:01 -07:00
1 parent 17b37d3e76
commit d3837a3a0a
2 files changed
+112

No files matched your search

+1
View File
@@ -2039,6 +2039,7 @@ fn deductible_amount_rounds_once() {
assert!(want <= 0, "the sum's sign, not its opposite");
}
kani::cover!(n == T && exact % 100 == 50, "a tie at half a cent");
kani::cover!(exact % 100 == -50, "a negative tie at half a cent");
kani::cover!(exact < 0, "a negative numerator (a refund)");
kani::cover!(
per_account != want,