diff options
Diffstat (limited to 'src/pkg/encoding/csv/reader_test.go')
-rw-r--r-- | src/pkg/encoding/csv/reader_test.go | 33 |
1 files changed, 18 insertions, 15 deletions
diff --git a/src/pkg/encoding/csv/reader_test.go b/src/pkg/encoding/csv/reader_test.go index 5fd84a76b..123df06bc 100644 --- a/src/pkg/encoding/csv/reader_test.go +++ b/src/pkg/encoding/csv/reader_test.go @@ -171,32 +171,32 @@ field"`, Output: [][]string{{"a", "b", "c"}, {"d", "e"}}, }, { - Name: "BadTrailingCommaEOF", - Input: "a,b,c,", - Error: "extra delimiter at end of line", Line: 1, Column: 5, + Name: "TrailingCommaEOF", + Input: "a,b,c,", + Output: [][]string{{"a", "b", "c", ""}}, }, { - Name: "BadTrailingCommaEOL", - Input: "a,b,c,\n", - Error: "extra delimiter at end of line", Line: 1, Column: 5, + Name: "TrailingCommaEOL", + Input: "a,b,c,\n", + Output: [][]string{{"a", "b", "c", ""}}, }, { - Name: "BadTrailingCommaSpaceEOF", + Name: "TrailingCommaSpaceEOF", TrimLeadingSpace: true, Input: "a,b,c, ", - Error: "extra delimiter at end of line", Line: 1, Column: 5, + Output: [][]string{{"a", "b", "c", ""}}, }, { - Name: "BadTrailingCommaSpaceEOL", + Name: "TrailingCommaSpaceEOL", TrimLeadingSpace: true, Input: "a,b,c, \n", - Error: "extra delimiter at end of line", Line: 1, Column: 5, + Output: [][]string{{"a", "b", "c", ""}}, }, { - Name: "BadTrailingCommaLine3", + Name: "TrailingCommaLine3", TrimLeadingSpace: true, Input: "a,b,c\nd,e,f\ng,hi,", - Error: "extra delimiter at end of line", Line: 3, Column: 4, + Output: [][]string{{"a", "b", "c"}, {"d", "e", "f"}, {"g", "hi", ""}}, }, { Name: "NotTrailingComma3", @@ -231,7 +231,7 @@ x,,, }, }, { - Name: "Issue 2366", + Name: "TrailingCommaIneffective1", TrailingComma: true, TrimLeadingSpace: true, Input: "a,b,\nc,d,e", @@ -241,11 +241,14 @@ x,,, }, }, { - Name: "Issue 2366a", + Name: "TrailingCommaIneffective2", TrailingComma: false, TrimLeadingSpace: true, Input: "a,b,\nc,d,e", - Error: "extra delimiter at end of line", + Output: [][]string{ + {"a", "b", ""}, + {"c", "d", "e"}, + }, }, } |