summaryrefslogtreecommitdiffstats
path: root/vendor/golang.org/x/image/font/plan9font/plan9font_test.go
blob: 23393a176ad878ccc07116051f05db96d09a1797 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
// Copyright 2016 The Go Authors. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.

package plan9font

import (
	"io/ioutil"
	"path/filepath"
	"testing"
)

func BenchmarkParseSubfont(b *testing.B) {
	subfontData, err := ioutil.ReadFile(filepath.FromSlash("../testdata/fixed/7x13.0000"))
	if err != nil {
		b.Fatal(err)
	}
	b.ResetTimer()
	for i := 0; i < b.N; i++ {
		if _, err := ParseSubfont(subfontData, 0); err != nil {
			b.Fatal(err)
		}
	}
}