File: text_csv_test.go

package info (click to toggle)
golang-github-gabriel-vasile-mimetype 1.4.8%2Bdfsg1-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 464 kB
  • sloc: makefile: 3
file content (20 lines) | stat: -rw-r--r-- 317 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
package magic

import (
	"io"
	"math/rand"
	"testing"
)

func BenchmarkCsv(b *testing.B) {
	r := rand.New(rand.NewSource(0))
	data := make([]byte, 4096)
	if _, err := io.ReadFull(r, data); err != io.ErrUnexpectedEOF && err != nil {
		b.Fatal(err)
	}

	b.ReportAllocs()
	for i := 0; i < b.N; i++ {
		Csv(data, 0)
	}
}