File: decode_bench_test.go

package info (click to toggle)
golang-github-naoina-toml 0.1.1-8
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, sid, trixie
  • size: 416 kB
  • sloc: makefile: 7
file content (17 lines) | stat: -rw-r--r-- 246 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
package toml

import (
	"testing"
)

func BenchmarkUnmarshal(b *testing.B) {
	var v testStruct
	data := loadTestData("test.toml")
	b.ResetTimer()

	for i := 0; i < b.N; i++ {
		if err := Unmarshal(data, &v); err != nil {
			b.Fatal(err)
		}
	}
}