fix csv test
parent
7069cd6ab5
commit
30fc29fa6d
|
@ -124,16 +124,16 @@ fn (r mut Reader) read_record() ?[]string {
|
||||||
// quoted
|
// quoted
|
||||||
else {
|
else {
|
||||||
line = line[1..]
|
line = line[1..]
|
||||||
if i := line.index('"') {
|
if j := line.index('"') {
|
||||||
if i+1 == line.len {
|
if j+1 == line.len {
|
||||||
// last record
|
// last record
|
||||||
fields << line[..i]
|
fields << line[..j]
|
||||||
break
|
break
|
||||||
}
|
}
|
||||||
next := line[i+1]
|
next := line[j+1]
|
||||||
if next == r.delimiter {
|
if next == r.delimiter {
|
||||||
fields << line[..i]
|
fields << line[..j]
|
||||||
line = line[i..]
|
line = line[j..]
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue