You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
fix(calc): NOW/TODAY clock at autofill/paste/command, formatted-value tests
### NOW/TODAY clock at user-action boundaries beyond editing
Tier 2 fixed the interactive-edit path (editing.rs). The other user-
action eval sites had the same NOW/TODAY divergence on multi-cell ops:
* autofill.rs — both row and column autofill paths
* clipboard.rs — multi-cell paste + single-cell paste
* command.rs — `:table create` initial value eval
Each now wraps its `evaluator.evaluate_formula` call in
`with_recalc_clock(now_serial(), || ...)` so any volatile cells in the
filled / pasted / created formulas see the same clock the immediately-
following auto-recalc will. Previously, an autofilled column of `=NOW()`
formulas could briefly flash with multiple distinct wall-clock times
before the recalc collapsed them onto a single snapshot — now the
filled values agree from the start.
### Expanded executor-parity fuzz to 6 formula shapes
Was: only `+ - *` on cell refs. Now picks per cell from:
* arithmetic chain (original)
* IF with `>`-comparison branches
* SUM over a B-column helper sub-range
* MAX over a B-column helper sub-range
* ABS of a referenced cell
* VLOOKUP (approximate-match) into the helper column
A small mirror block in column B (cells 0..helpers) gives range-aware
functions something contiguous to consult. 20 random seeds still pass —
the property is "Sequential and Parallel agree on every cell," and the
expanded coverage exercises far more of the executor's per-purity
dispatch surface.
### Number-formatting scenario + 2 product fixes it caught
New scenario `formatting` puts (raw value, format command) pairs into
column A and asserts the rendered cell text contains the expected
formatted substring (e.g. raw=9876.54 + currency → "$9,876.54").
Framework gains a `rendered_text_checks` method on Scenario (defaults
empty) and a `RenderedTextCheck` type. Runner asserts post-recalc and
post-auto-fit.
The scenario caught two real product bugs:
* **Currency rendered sign in wrong place.** -42.5 with currency
format displayed as `$-42.50`. Excel convention is `-$42.50` —
sign BEFORE the symbol. Fixed in `style::format_cell_value`
(Currency branch): format the absolute value, then prepend sign.
* **Auto-resize ignored formatted width.** `auto_resize_column` and
`auto_resize_all_columns` measured `cell.value.width()` (raw),
so a `9876.54` raw value sized to 7 chars even though the
currency-formatted display needs 9. Both helpers now call
`format_cell_value` to size by what the user actually sees.
Tests: 592 lib + 19 PTY scenarios (+1 formatting) + all 11 PTY suites
green. Zero warnings.
0 commit comments