diff options
| author | Paul Buetow <paul@buetow.org> | 2026-05-23 21:11:32 +0300 |
|---|---|---|
| committer | Paul Buetow <paul@buetow.org> | 2026-05-23 21:11:32 +0300 |
| commit | 5ea6e73fda9fc12dbccf472b116a69eed0871a37 (patch) | |
| tree | e62b1b0b1abbd3f4f1b43ab60ebfca7cfcbab105 /internal/rpn | |
| parent | 440cd6adf44324584ab784389a373058fa93c3c8 (diff) | |
test: add unit tests for ParseCalculation() and Calculation.Format()
Add tests for ParseCalculation() exported API and Calculation struct:
- ParseCalculation returns correct *Calculation for all 3 types
(PercentOfY, IsWhatPercentOfY, IsYPercentOfWhat)
- Correct field values: Type, Percent, Base, Result, Steps
- 'what is' prefix stripping via ParseCalculation
- Case insensitivity via ParseCalculation
- Division by zero edge cases via ParseCalculation
- Invalid input returns error via ParseCalculation
- Calculation.Format() for each CalculationType
- Calculation.Format() with and without Steps
- Decimal and large value handling
Diffstat (limited to 'internal/rpn')
0 files changed, 0 insertions, 0 deletions
