aboutsummaryrefslogtreecommitdiff
path: root/src/encoding/csv/reader_test.go
diff options
context:
space:
mode:
authorRuss Cox <rsc@golang.org>2017-11-16 10:29:50 -0500
committerRuss Cox <rsc@golang.org>2017-11-16 16:29:37 +0000
commit1d47a145913f76f64414bbbc14bff3c95450535e (patch)
tree0444d95ec60f84cb4410590b1e06712ca99ac78a /src/encoding/csv/reader_test.go
parent918b98ca707e36ec84c0494b884ff0a02c9121c2 (diff)
downloadgo-1d47a145913f76f64414bbbc14bff3c95450535e.tar.xz
encoding/csv: restore Go 1.9 quoted \r\n handling in Reader
CL 52810 changed Reader to interpret a quoted \r\n as a raw \r\n when reading fields. This seems likely to break existing users, and discussion on both #21201 (the original issue that triggered the change) and #22746 (discussing whether to revert the change) failed to identify a single motivating example for this change. To avoid breaking existing users for no clear reason, revert the change. The Reader has been rewritten in the interim so this is not a git revert but instead and adjustment (and slight simplification) of the new Reader. Fixes #22746. Change-Id: Ie857b2f4b1359a207d085b6d3c3a6d440a997d12 Reviewed-on: https://go-review.googlesource.com/78295 Reviewed-by: Joe Tsai <thebrokentoaster@gmail.com>
Diffstat (limited to 'src/encoding/csv/reader_test.go')
-rw-r--r--src/encoding/csv/reader_test.go4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/encoding/csv/reader_test.go b/src/encoding/csv/reader_test.go
index 69e2e2becd..d62aa77382 100644
--- a/src/encoding/csv/reader_test.go
+++ b/src/encoding/csv/reader_test.go
@@ -235,9 +235,9 @@ x,,,
Error: &ParseError{StartLine: 2, Line: 5, Column: 0, Err: ErrQuote},
}, {
Name: "CRLFInQuotedField", // Issue 21201
- Input: "\"Hello\r\nHi\"",
+ Input: "A,\"Hello\r\nHi\",B\r\n",
Output: [][]string{
- {"Hello\r\nHi"},
+ {"A", "Hello\nHi", "B"},
},
}, {
Name: "BinaryBlobField", // Issue 19410