Bug 21629 – std.csv report one record on empty input

Status
RESOLVED
Resolution
FIXED
Severity
enhancement
Priority
P3
Component
phobos
Product
D
Version
D2
Platform
All
OS
All
Creation time
2021-02-11T13:09:34Z
Last change time
2021-02-22T20:03:04Z
Keywords
pull
Assigned to
No Owner
Creator
deadalnix

Comments

Comment #0 by deadalnix — 2021-02-11T13:09:34Z
I have the following dumbed down sample: struct Reccord { string a; string b; } import std.csv; string input = ""; foreach (reccord; cvsReader!Reccord(input)) { assert(0, "No reccord are expected"); } This sample code trips the assert as cvsReccord emit one empty record with an empty a and b. I think this is erroneous.
Comment #1 by rburners — 2021-02-11T14:19:22Z
I'll take a look
Comment #2 by dlang-bot — 2021-02-11T14:58:40Z
@burner created dlang/phobos pull request #7788 "Fixes #21629" fixing this issue: - Fixes #21629 https://github.com/dlang/phobos/pull/7788
Comment #3 by dlang-bot — 2021-02-22T20:03:04Z
dlang/phobos pull request #7788 "Fixes #21629: std.csv report one record on empty input" was merged into master: - fac12450fbf6b707976cc84694e94c3c363bc75f by Robert burner Schadek: Fixes #21629 * nicer assert * fixing the cov linter hints * forgot some dead code https://github.com/dlang/phobos/pull/7788