Skip to content

test(conformance): silently skipped rows assert nothing — 46 in text.tsv alone, and one pair passed for the wrong reason #767

Description

@hhimanshu

What

The conformance TSV runner skips any row whose expected value is empty, and has no comparison arm for a result that is not a number/text/boolean/error/array. Together these mean a whole class of fixture rows is recorded, looks enforced, and asserts nothing.

Why this matters now

SPARKLINE (#766) is the first function whose successful result has no text projection — Sheets displays it as empty. Every "this renders fine" row therefore has an empty expected value, and:

  • The runner skips them. crates/core/tests/conformance.rs (the formula.is_empty() || expected_str.trim().is_empty() guard) drops the row before evaluation. Of the first 28 SPARKLINE rows added, 13 are inert — every charttype row, the colour and ymin/ymax rows, unknown-option-key, bar-with-three-values, text-in-data, all-negative, and both real-range rows.
  • Including one that matters. TO_TEXT(SPARKLINE(...))"" is one of three deliberately pinned coercion exceptions, and the conformance gate does not check it. Only a hand-written test does.
  • The new infer_type arm is dead code. No enforced row produces a non-scalar value, so the arm added to conformance.rs and conformance_reporter.rs is never reached.
  • A filled-in row would fail. values_match has no arm pairing a non-scalar actual against a text expected. If someone later gives one of these rows a non-empty expected value, it fails for a harness reason rather than a conformance reason — which is the worst possible failure, because it looks like a real divergence.

The empty-expected skip is right for genuinely unknown rows. It is wrong when empty is the observed value.

The distinction the format cannot currently express

Three different things collapse into an empty cell today:

  1. not yet probed
  2. probed, and the result is the empty string
  3. probed, and the result is a value with no text projection at all

Only (1) should be skipped. Today all three are.

Sketch of a fix

Not prescriptive — whoever picks this up should weigh these:

  • Use the existing expected_type column, which already carries a per-row type hint, to distinguish "no text projection" from "not probed" without a format change.
  • Or add an explicit sentinel for "observed empty" so the skip rule can be narrowed to genuinely-unknown rows.
  • Either way, values_match needs an arm for a non-scalar actual, and the reporter should count skipped rows visibly so a silently-inert block cannot grow again unnoticed.

Whatever is chosen must not disturb the existing skip behaviour for rows that really are unprobed.

Acceptance criteria

  • A fixture row can assert "this evaluates successfully and has no text projection" and actually enforce it
  • values_match handles a non-scalar actual rather than failing for a harness reason
  • The runner reports how many rows it skipped, so inert blocks are visible
  • The previously-inert SPARKLINE rows become enforced
  • Genuinely-unprobed rows still skip as before
  • CI green

Related

Metadata

Metadata

Assignees

Labels

enhancementNew feature or request

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions