Beispiel
Demonstrate that NimbleCSV.parse_string defaults to skip_headers: true, discarding the first row, and verify its quote escaping and UTF-8 BOM preservation behaviors.
sha256:ae21b951308d6bac196db85fb726efc75244ff77210adc6af5babba86658e6c1
PUBLISHED
L3_CONTRACT_PASS
MIT-0
Ausführungsbelege
Deklarierte Umgebung und signierte Prüfläufe werden getrennt dargestellt.
BeleggrundlageSignierter Vertrag bestanden
Verifizierungsbelege1
VerifizierungsstufeL3_CONTRACT_PASS
Deklarierte Umgebung
- Ausführungskontext
- elixir
- Betriebssystem
- linux
- Architektur
- x64
- Runtime
- elixir
- Sprache
- elixir
- Paketmanager
- mix
Umgebungen der Verifizierungsläufe
- Ausführungskontext
- elixir 1
- Betriebssystem
- linux alpine · musl
- Architektur
- x64
- Runtime
- elixir 1
- Sprache
- elixir
- Paketmanager
- mix
- Ausführung
- container · docker
CONTAINER_RUN · compile:PASS · contract:PASS · load:PASS · resolve:PASS · hex@1 · 2026-08-17
Fall
- Ziel
- Demonstrate that NimbleCSV.parse_string defaults to skip_headers: true, discarding the first row, and verify its quote escaping and UTF-8 BOM preservation behaviors. HOW
- Pakete
-
nimble_csv 1.3.0
- Umgebung
- elixir
- Erstellt
- 2026-08-17T07:29:23Z
Häufige Annahme
NimbleCSV.parse_string parses all CSV rows by default, returning a one-row list for single-line CSV and a list containing header and data rows for multiline CSV.
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
- NimbleCSV.RFC4180.parse_string defaults to skip_headers: true, returning an empty list for a single-row CSV and omitting the header row for multiline CSV unless skip_headers: false is explicitly passed.
- assert single-row string without options returns empty list while skip_headers: false returns the row
- assert multiline CSV with embedded newlines in quotes and escaped double-quotes parses into multiline field values
- assert unescaped quote inside a field raises NimbleCSV.ParseError
- assert RFC4180 parse_string preserves UTF-8 BOM in the first field unless a custom parser is defined with trim_bom: true
Dateien
- NOTES.md
- csx.json
- mix.exs
- mix.lock
- test/contract.exs
Quellartefakt herunterladen (tar.gz)
Ursprungs-Seeder
csx-seed
Verifizierungsbelege
- elixir 1 · linux alpine/x64 · docker · CONTAINER_RUN · compile:PASS · contract:PASS · load:PASS · resolve:PASS · hex@1 · 2026-08-17 · ed25519:d91480838ac982c9