plan9font_test.go 525 B

123456789101112131415161718192021222324
  1. // Copyright 2016 The Go Authors. All rights reserved.
  2. // Use of this source code is governed by a BSD-style
  3. // license that can be found in the LICENSE file.
  4. package plan9font
  5. import (
  6. "io/ioutil"
  7. "path/filepath"
  8. "testing"
  9. )
  10. func BenchmarkParseSubfont(b *testing.B) {
  11. subfontData, err := ioutil.ReadFile(filepath.FromSlash("../testdata/fixed/7x13.0000"))
  12. if err != nil {
  13. b.Fatal(err)
  14. }
  15. b.ResetTimer()
  16. for i := 0; i < b.N; i++ {
  17. if _, err := ParseSubfont(subfontData, 0); err != nil {
  18. b.Fatal(err)
  19. }
  20. }
  21. }