diff options
| author | Paul Buetow <paul@buetow.org> | 2026-05-23 21:01:54 +0300 |
|---|---|---|
| committer | Paul Buetow <paul@buetow.org> | 2026-05-23 21:01:54 +0300 |
| commit | a43272007fa4f13a5161257bfe85649874724da2 (patch) | |
| tree | c913b07d5e7431ba7c69f3f9341d0aabba018c30 /internal/rpn/operations_stack_test.go | |
| parent | 174b313c5ea475ff0baadf409f226d3e7b65738a (diff) | |
test: add unit tests for variable persistence (Variables.Load/Save)
Add persistence_test.go with 12 tests covering:
- Load from corrupt JSON file returns proper error
- Load filters invalid variable names (empty, spaces, symbols)
- Round-trip Save/Load with 9 diverse float64 values (zero, negative,
large, small, scientific, pi, integer, decimal)
- Save produces sorted, indented JSON format
- Save/Load with 50 variables
- Concurrent SetVariable/GetVariable/Count/ListVariables on same instance
- Load from empty JSON array succeeds with empty result
- Load from corrupt file preserves existing variables (error before lock)
- Save with Inf values returns error (JSON cannot represent Inf)
- Load with duplicate names — last value wins
- Load from empty file returns error (invalid JSON)
Diffstat (limited to 'internal/rpn/operations_stack_test.go')
0 files changed, 0 insertions, 0 deletions
