Skip to content

Test against files hucre did not write #464

Description

@productdevbook

Split out of #439 §G1. The single highest-value item on that list, and the one thing the 23 PRs could not do.

The problem

$ find test -type f ! -name '*.ts' ! -name '*.snap' | wc -l
0

9,934 tests, 181 files, and not one byte produced by Excel, LibreOffice, Google Sheets, SheetJS or ExcelJS is ever parsed. Every assertion is hucre writing something and hucre reading it back.

A writer bug the reader mirrors is invisible. That is not hypothetical — three of the defects fixed this round were exactly that shape, and all three sat in main at 98.8% statement coverage:

why the suite could not see it
xml:space missing on inline strings (#441) hucre's reader does not trim, so the round trip agreed with itself. Only Excel disagrees.
XLS/XLSB reading CJK dates as raw serials (#444) the date-id table was 61% complete; no real .xls was ever opened
saveXlsx emitting a duplicate part (#460) ZipWriter accepted the duplicate and extract returned the last one

The XLS (BIFF8) and XLSB readers are the sharpest case: they exist solely to consume other tools' output, and are validated only against byte arrays the tests construct themselves.

What would help

A small, licence-clean corpus under test/fixtures/ — a dozen files is plenty — with a golden-model test per file. The shapes that matter, roughly in order:

  • Excel, LibreOffice and Google Sheets each writing the same simple sheet: strings, numbers, dates, booleans, a formula with a cached result
  • shared strings and inline strings, including values with leading/trailing whitespace
  • a styled sheet: fonts, fills, borders, number formats, a column-level format
  • merges, a frozen pane, a conditional rule
  • a .xls and a .xlsb from a real Excel, ideally one with a CJK locale so the date block is exercised
  • one file with a <tfoot>-style oddity or an unusual paper size

Licensing is the thing to get right: files someone on the project authored, or something already under a permissive licence. Not scraped documents.

Why it is not in the batch

There is no Excel, LibreOffice or openpyxl in the environment those PRs were written in, so no genuinely third-party file could be produced. Generating fixtures with hucre would defeat the entire point.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions