Skip to content

Mine the open-source readers' test suites for edge cases we do not cover #8

Closed

Description

@vaceslav

The libraries in the comparison benchmark have years of bug reports behind their tests. Their suites are the cheapest source of real-world edge cases — odd producers, malformed files, format corners — that our own fixtures may not pin yet.

Go through the test suites of the open-source readers and list, per case, whether TriasDev.Tabular already covers it:

  • csv: Sylvan.Data.Csv, Sep, CsvHelper
  • xlsx: Sylvan.Data.Excel, ExcelDataReader, MiniExcel, DocumentFormat.OpenXml, ClosedXML, NPOI, EPPlus (4.x, LGPL)

For each gap: write a fixture from raw bytes / raw OOXML in our own style (never copy their test files — licences differ, and our fixtures are built by hand on purpose), decide the expected behaviour, and fix the reader where it is wrong.

Areas to look for in particular:

  • csv: encodings and BOMs, line-ending mixes, quoting and escaping variants, delimiter detection corners, very wide/long rows, trailing delimiters, empty files
  • xlsx: producers other than Excel (LibreOffice, Google Sheets, Numbers, generators), strict OOXML, shared-string oddities, rich text/phonetic runs, 1904 epoch, date formats, formula cells with cached values, errors, missing parts, relationship quirks, zip64, huge/empty sheets
  • Record which cases we deliberately do not support, in README / KNOWN-ISSUES

Activity

  1. vaceslav commented on Sep 25, 2026

    @vaceslav
    ContributorAuthor

    xlsx — done (52c5fc2, 3b3add5, 8eb6890, 7ed3376)

    Read the ~1,100 test workbooks of ClosedXML, ExcelDataReader, MiniExcel, NPOI, Sylvan.Data.Excel and EPPlus through TriasDev.Tabular, Sylvan.Data.Excel and ExcelDataReader, and compared sheet by sheet (the files were read locally, none copied; every fixture added is rebuilt from raw OOXML in Xlsx/ProducerQuirksTests.cs).

    Failures only we had went from 30 to 8, and the 8 left are refusals on purpose — encrypted (non-zip) workbooks, DTD / XML-bomb files, and one package that references a worksheet part it does not contain. Fixed:

    • Hang: an empty shared string <si><t/></si> made the reader loop forever (16 files).
    • Elements with more than 16 attributes (sparklines) refused the whole sheet.
    • Parts are now found through the package relationships: workbook outside xl/, backslash entry names, strict OOXML's r:id namespace, ../ targets; chart/macro/dialog sheets are no longer offered as sheets.
    • <x15:workbookPr> reset the 1904 epoch (dates four years early).
    • Serial dates rounded to the millisecond (16:00 read as 15:59:59.999).
    • East Asian built-in date formats 27–36 and 50–58.
    • <rPh> phonetic text left out of the value.

    Deliberate differences kept: error cells return their text (#DIV/0!), hidden sheets are listed, rows are returned as written when a file repeats a row number. Idea from the comparison: expose a sheet's visibility on SheetInfo.

    csv — still to do

    Sep, CsvHelper and Sylvan.Data.Csv keep their cases inline in test code rather than as files, so that half is a read of their test sources.

  2. vaceslav commented on Sep 25, 2026

    @vaceslav
    ContributorAuthor

    csv — done

    140 distinct inputs harvested from the test suites of Sep, CsvHelper and Sylvan.Data.Csv, each read by TriasDev.Tabular (with the same delimiter and quote) and by the three libraries, and compared.

    • 82 agree with all three; 40 agree with one or two where the libraries also disagree among themselves.
    • Every case where we differ from the others is a documented choice: values are trimmed (" a " → a, also inside quotes), # lines are not comments, a BOM is removed, delimiters are a single character.
    • One real gap, now csv: a legitimate quoted field longer than four lines is split #10: a well-formed quoted field of more than four lines is split, because of the unterminated-quote bound.

    No reader crashed, hung or threw on any of the 140 inputs.

    Closing this issue: the xlsx findings are fixed, the csv one is tracked in #10, and the sheet-visibility idea can go to docs/IDEAS.md.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions