summaryrefslogtreecommitdiff
path: root/src/encoding/csv/reader_test.go
diff options
context:
space:
mode:
Diffstat (limited to 'src/encoding/csv/reader_test.go')
-rw-r--r--src/encoding/csv/reader_test.go22
1 files changed, 22 insertions, 0 deletions
diff --git a/src/encoding/csv/reader_test.go b/src/encoding/csv/reader_test.go
index 123df06bc8..b3c4f3bf18 100644
--- a/src/encoding/csv/reader_test.go
+++ b/src/encoding/csv/reader_test.go
@@ -282,3 +282,25 @@ func TestRead(t *testing.T) {
}
}
}
+
+func BenchmarkRead(b *testing.B) {
+ data := `x,y,z,w
+x,y,z,
+x,y,,
+x,,,
+,,,
+"x","y","z","w"
+"x","y","z",""
+"x","y","",""
+"x","","",""
+"","","",""
+`
+
+ for i := 0; i < b.N; i++ {
+ _, err := NewReader(strings.NewReader(data)).ReadAll()
+
+ if err != nil {
+ b.Fatalf("could not read data: %s", err)
+ }
+ }
+}