test(pricing): cover 30 untested money-path cases (#50)

Merged
IC
3d ago
+628-14

Which issue gave this a go?

#50, the go of 2026-12-03 19:18Z.

Closes #50

What changed

This PR adds 22 tests in astrocyte-core for price arithmetic and list valuation. It changes only test code. One BROCA test helper in pricing.rs gets its measurements and rates as parameters, with the same values. This PR also has the three tests that the issue patch did not have: pricing_batch2_mutation_token_selector_cannot_claim_cache_lifetime, pricing_mutation_list_value_keeps_conflicting_mode_aliases_unvalued and pricing_mutation_list_value_does_not_treat_euros_as_dollars.

What proves it

  • Test: the 22 tests named pricing_mutation_* and pricing_batch2_mutation_* in pricing.rs, pricing_unit_billing_tests.rs, multiplier/shared_valuer_tests.rs and report/hourly/valuation/tests.rs.
  • Failed without the fix: this PR has no production change. For each of the 30 cases in #50, I applied that one code change and ran its test. Each test stopped on an equality assertion (assertion left == right failed). The same test is satisfactory on the unchanged code. No test can be satisfactory without its case: each test compares the accurate charge, quantity, rate key or outcome.
  • At this branch on Linux, these commands are satisfactory: scripts/fmt-check.sh, cargo clippy --workspace --all-targets --locked -- -D warnings and cargo test --workspace --all-targets --locked (2,335 satisfactory, 0 unsatisfactory, 38 ignored).

AI helped write this draft.


Summary by cubic

Adds 22 tests in astrocyte-core that cover the 30 untested money-path cases in #50, closing it. This PR changes test code only; each test asserts exact charge, quantity, rate key, or outcome values, so it passes on unchanged code and fails on an equality assertion when its case behavior is altered.

  • The BROCA helper in pricing.rs now takes its measurements and rates as parameters, with the same values as before.
  • Includes three tests beyond the issue patch: pricing_batch2_mutation_token_selector_cannot_claim_cache_lifetime, pricing_mutation_list_value_keeps_conflicting_mode_aliases_unvalued, and pricing_mutation_list_value_does_not_treat_euros_as_dollars.
  • Verified with scripts/fmt-check.sh, cargo clippy --workspace --all-targets --locked -- -D warnings, and cargo test --workspace --all-targets --locked (2,335 passing, 0 failing, 38 ignored).