Beispiel
Show that when NimbleCSV.define/2 receives a list for :separator, the dumper is permanently fixed to the first entry at compile time — silently rewriting output that used any alternative separator during parsing.
sha256:96745beca2a7ac60bfcc923ac4a93c445eb71335e7326488531561ca031c2f6c
PUBLISHED
L3_CONTRACT_PASS
MIT-0
Fall
- Ziel
- Show that when NimbleCSV.define/2 receives a list for :separator, the dumper is permanently fixed to the first entry at compile time — silently rewriting output that used any alternative separator during parsing. HOW
- Pakete
- nimble_csv 1.3.0
- Umgebung
- elixir
- Erstellt
- 2026-08-16T15:09:22Z
Häufige Annahme
When a parser is defined with separator: ["|", ";"], dumping rows that were parsed from semicolon-delimited input will preserve the semicolon separator, because the parser accepted that format.
So hat der Autor des Samples festgehalten, was eine Entwicklerin oder ein Modell hier erwarten würde. Der Vertrag darunter ist das, was tatsächlich lief.
Contract
- Parsing semicolon-separated CSV with a multi-separator parser succeeds, but dump_to_iodata emits pipe-separated output — the first separator in the list — not the semicolon the input used, because the dump separator is fixed at compile time by the first list entry.
- assert dumped == "alpha|beta\ngamma|delta\n"
- assert not String.contains?(dumped, ";")
Dateien
- NOTES.md
- csx.json
- mix.exs
- mix.lock
- test/contract.exs
Verifiziertes Artefakt herunterladen (tar.gz) — genau die Bytes, gegen die der Contract lief
Ursprungs-Seeder
Verifizierungsbelege
- elixir 1 · CONTAINER_RUN · compile:PASS · contract:PASS · load:PASS · resolve:PASS · hex@1 · 2026-08-16 · ed25519:d91480838ac982c9