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.
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