test(core): what exact tie ranking moves
Keeps the old ranking (the rounded quotient's remainder, built from the kernel's own share_of, round_places and apportion) as a reference and measures, over realistic inputs (whole-cent amounts to 1,000,000.00, two to five parties, whole-percentage or small-integer weights), how often it differs from the exact ranking. Run with --nocapture for the table. What it shows: the rankings part only at an exact tie between unequal parts over a total whose division does not terminate. Equal weights never differ (every remainder is equal, so both give the leftover cents to the earlier parts); two parties never differ (a tie leaves each share ending in exactly half a cent, a terminating quotient); percentages summing to 100 never differ (the quotient is exact). A difference is at most one cent a part and the parts still sum to the whole. The tests assert that structure and print the rates. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
294cb99a58
commit
b810e6102b
2 files changed
+342
No files matched your search
@@ -15,6 +15,7 @@ mod payroll;
|
||||
mod ratio;
|
||||
mod round;
|
||||
mod schedule;
|
||||
mod ties;
|
||||
mod total;
|
||||
|
||||
use ledger_core::kernel::{self, Amount, LineError};
|
||||
|
||||
Reference in new issue
Block a user