]> Cypherpunks repositories - gostls13.git/commitdiff
encoding/csv: test that carriage return is handled in Write
authorShawn Smith <shawn.p.smith@gmail.com>
Tue, 7 Jan 2014 17:32:15 +0000 (09:32 -0800)
committerRob Pike <r@golang.org>
Tue, 7 Jan 2014 17:32:15 +0000 (09:32 -0800)
R=golang-codereviews, r
CC=golang-codereviews
https://golang.org/cl/46310043

src/pkg/encoding/csv/writer_test.go

index 03ca6b093c03b6ebc169330b88ca24d1570ea52c..22b740c0745297edf0db0da8f9561846b04e7276 100644 (file)
@@ -26,6 +26,8 @@ var writeTests = []struct {
        {Input: [][]string{{"abc"}, {"def"}}, Output: "abc\ndef\n"},
        {Input: [][]string{{"abc\ndef"}}, Output: "\"abc\ndef\"\n"},
        {Input: [][]string{{"abc\ndef"}}, Output: "\"abc\r\ndef\"\r\n", UseCRLF: true},
+       {Input: [][]string{{"abc\rdef"}}, Output: "\"abcdef\"\r\n", UseCRLF: true},
+       {Input: [][]string{{"abc\rdef"}}, Output: "\"abc\rdef\"\n", UseCRLF: false},
 }
 
 func TestWrite(t *testing.T) {