Debian Codegraph @

text_test.go

raw symbols SCIP
1 package plist
2
3 import (
4 "bytes"
5 "io/ioutil"
6 "testing"
7 )
8
9 func BenchmarkOpenStepGenerate(b *testing.B) {
10 for i := 0; i < b.N; i++ {
11 d := newTextPlistGenerator(ioutil.Discard, OpenStepFormat)
12 d.generateDocument(plistValueTree)
13 }
14 }
15
16 func BenchmarkOpenStepParse(b *testing.B) {
17 buf := bytes.NewReader([]byte(plistValueTreeAsOpenStep))
18 b.ResetTimer()
19 for i := 0; i < b.N; i++ {
20 b.StartTimer()
21 d := newTextPlistParser(buf)
22 d.parseDocument()
23 b.StopTimer()
24 buf.Seek(0, 0)
25 }
26 }
27
28 func BenchmarkGNUStepParse(b *testing.B) {
29 buf := bytes.NewReader([]byte(plistValueTreeAsGNUStep))
30 b.ResetTimer()
31 for i := 0; i < b.N; i++ {
32 b.StartTimer()
33 d := newTextPlistParser(buf)
34 d.parseDocument()
35 b.StopTimer()
36 buf.Seek(0, 0)
37 }
38 }
39
40 // The valid text test cases have been merged into the common/global test cases.