aboutsummaryrefslogtreecommitdiff
path: root/src/encoding/csv/reader_test.go
diff options
context:
space:
mode:
authorRuss Cox <rsc@golang.org>2017-11-14 13:23:10 -0500
committerRuss Cox <rsc@golang.org>2017-11-15 21:26:52 +0000
commitc4c3f2a1f2d9ee0735aba1583bb2a3301ec790d3 (patch)
treee08d24089a784ece80eba485f438c7490ad3707a /src/encoding/csv/reader_test.go
parent9232a612fed58d2629073056f827db3fae0cd5f0 (diff)
downloadgo-c4c3f2a1f2d9ee0735aba1583bb2a3301ec790d3.tar.xz
encoding/csv: rename ParseError.RecordLine to .StartLine
A record can span multiple lines (the whole reason for the extra field), so the important fact is that it's the _start_ of the record. Make that clear in the name. (This API was added during the Go 1.10 cycle so it can still be cleaned up.) Change-Id: Id95b3ceb7cdfc4aa0ed5a053cb84da8945fa5496 Reviewed-on: https://go-review.googlesource.com/78119 Run-TryBot: Russ Cox <rsc@golang.org> Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org> Reviewed-by: Joe Tsai <thebrokentoaster@gmail.com>
Diffstat (limited to 'src/encoding/csv/reader_test.go')
-rw-r--r--src/encoding/csv/reader_test.go24
1 files changed, 12 insertions, 12 deletions
diff --git a/src/encoding/csv/reader_test.go b/src/encoding/csv/reader_test.go
index 48efbb6719..69e2e2becd 100644
--- a/src/encoding/csv/reader_test.go
+++ b/src/encoding/csv/reader_test.go
@@ -123,7 +123,7 @@ field"`,
}, {
Name: "BadDoubleQuotes",
Input: `a""b,c`,
- Error: &ParseError{RecordLine: 1, Line: 1, Column: 1, Err: ErrBareQuote},
+ Error: &ParseError{StartLine: 1, Line: 1, Column: 1, Err: ErrBareQuote},
}, {
Name: "TrimQuote",
Input: ` "a"," b",c`,
@@ -132,25 +132,25 @@ field"`,
}, {
Name: "BadBareQuote",
Input: `a "word","b"`,
- Error: &ParseError{RecordLine: 1, Line: 1, Column: 2, Err: ErrBareQuote},
+ Error: &ParseError{StartLine: 1, Line: 1, Column: 2, Err: ErrBareQuote},
}, {
Name: "BadTrailingQuote",
Input: `"a word",b"`,
- Error: &ParseError{RecordLine: 1, Line: 1, Column: 10, Err: ErrBareQuote},
+ Error: &ParseError{StartLine: 1, Line: 1, Column: 10, Err: ErrBareQuote},
}, {
Name: "ExtraneousQuote",
Input: `"a "word","b"`,
- Error: &ParseError{RecordLine: 1, Line: 1, Column: 3, Err: ErrQuote},
+ Error: &ParseError{StartLine: 1, Line: 1, Column: 3, Err: ErrQuote},
}, {
Name: "BadFieldCount",
Input: "a,b,c\nd,e",
- Error: &ParseError{RecordLine: 2, Line: 2, Err: ErrFieldCount},
+ Error: &ParseError{StartLine: 2, Line: 2, Err: ErrFieldCount},
UseFieldsPerRecord: true,
FieldsPerRecord: 0,
}, {
Name: "BadFieldCount1",
Input: `a,b,c`,
- Error: &ParseError{RecordLine: 1, Line: 1, Err: ErrFieldCount},
+ Error: &ParseError{StartLine: 1, Line: 1, Err: ErrFieldCount},
UseFieldsPerRecord: true,
FieldsPerRecord: 2,
}, {
@@ -226,13 +226,13 @@ x,,,
},
ReuseRecord: true,
}, {
- Name: "RecordLine1", // Issue 19019
+ Name: "StartLine1", // Issue 19019
Input: "a,\"b\nc\"d,e",
- Error: &ParseError{RecordLine: 1, Line: 2, Column: 1, Err: ErrQuote},
+ Error: &ParseError{StartLine: 1, Line: 2, Column: 1, Err: ErrQuote},
}, {
- Name: "RecordLine2",
+ Name: "StartLine2",
Input: "a,b\n\"d\n\n,e",
- Error: &ParseError{RecordLine: 2, Line: 5, Column: 0, Err: ErrQuote},
+ Error: &ParseError{StartLine: 2, Line: 5, Column: 0, Err: ErrQuote},
}, {
Name: "CRLFInQuotedField", // Issue 21201
Input: "\"Hello\r\nHi\"",
@@ -290,7 +290,7 @@ x,,,
}, {
Name: "QuoteWithTrailingCRLF",
Input: "\"foo\"bar\"\r\n",
- Error: &ParseError{RecordLine: 1, Line: 1, Column: 4, Err: ErrQuote},
+ Error: &ParseError{StartLine: 1, Line: 1, Column: 4, Err: ErrQuote},
}, {
Name: "LazyQuoteWithTrailingCRLF",
Input: "\"foo\"bar\"\r\n",
@@ -307,7 +307,7 @@ x,,,
}, {
Name: "OddQuotes",
Input: `"""""""`,
- Error: &ParseError{RecordLine: 1, Line: 1, Column: 7, Err: ErrQuote},
+ Error: &ParseError{StartLine: 1, Line: 1, Column: 7, Err: ErrQuote},
}, {
Name: "LazyOddQuotes",
Input: `"""""""`,