Repository navigation
fix: read what real xlsx writers write; producer fixtures from seven writers - #42
Merged
Merged
Conversation
vaceslav
force-pushed
the
test/producers
branch
from
September 27, 2026 19:44
0ba6083 to
0313122
Compare
Contributor
Author
|
Quiet-machine timing, median of 3 alternating runs against main: every file within −0.7 % to +0.8 % (5M-row malformed csv −0.5 %, 1M-row workbook +0.1 %, 11M-row csv +0.2 %); every read fingerprint identical. |
This was referenced Sep 28, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Part of #16, item 5 (producer diversity).
tests/TriasDev.Tabular.Tests/Fixtures/Producersholds one small table as seven real producers write it: ClosedXML 0.105, the Open XML SDK 3.5, EPPlus 4.5.3.3, NPOI 2.7.6, MiniExcel 1.46, Sylvan.Data.Excel 0.5.8 and LibreOffice 26.8 (as xlsx, ods and csv). The files are embedded in the test assembly, andProducerFixtureTestsreads the table back from each. They are generated by a newwrite-producersmode of the comparison project; the README gives the commands. Google Sheets and Numbers are left out, since neither can be driven from a script. The files' metadata was checked and holds no user or path.Reading them turned up three reader defects. Each fix has a named test that failed first (
ProducerSpellingsTests):_xHHHH_escapes. ECMA-376 escapes a character as_xHHHH_, and an underscore that would start an escape as_x005F_. We read the escapes raw, so MiniExcel's emoji came back as_xD83D__xDE00_. A typed_x000D_came back as_x005F_x000D_from ClosedXML, EPPlus, Sylvan and LibreOffice. Escapes are now decoded in shared strings, inline strings and formula strings.true/false.new CellValue(true)in the Open XML SDK writestrue. Every boolean such a file held read asfalse.\r\nsurvived in a value. The shared string table, which goes throughXmlReader, was already normalised, so the same value read two ways depending on where it was stored. A character reference such as still keeps its carriage return.The fuzz now also covers
_xsequences, which the xlsx writer escapes as writers do, and line feeds written as a literal\r\n. Both run clean at 20 000 cases.NPOI and the Open XML SDK do not escape a typed
_x000D_, so it reads as a carriage return, which trimming then removes. Excel reads it the same way. The test records this rather than hiding it.Also:
HostileInputTests.ReadsAQuoteStormWithoutTakingQuadraticWorknow discards a first run, so once-per-process costs cannot flatter the ratio (#16, item 4).Every read fingerprint of the local real-file corpus (11 csv files, 4 large workbooks) matches
main. Timing is still to measure on a quiet machine before merge.