Skip to content

Commit

Permalink
Refactor tests
Browse files Browse the repository at this point in the history
  • Loading branch information
kaiburjack committed Feb 3, 2022
1 parent 65cf8b1 commit 50c1c30
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions combined_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,12 @@ func BenchmarkNamespaceAlias1Level(b *testing.B) {
r := strings.NewReader(input)
dec := gosaxml.NewDecoder(r)
enc := gosaxml.NewEncoder(io.Discard, gosaxml.NewNamespaceModifier())
var tk gosaxml.Token

b.ResetTimer()
b.ReportAllocs()

for i := 0; i < b.N; i++ {
var tk gosaxml.Token
r.Reset(input)
dec.Reset(r)
for {
Expand Down Expand Up @@ -87,12 +87,12 @@ func BenchmarkSameNamespaceSideBySide(b *testing.B) {
"</ns:a>")
dec := gosaxml.NewDecoder(r)
enc := gosaxml.NewEncoder(io.Discard, gosaxml.NewNamespaceModifier())
var tk gosaxml.Token

b.ReportAllocs()
b.ResetTimer()

for i := 0; i < b.N; i++ {
var tk gosaxml.Token
_, err := r.Seek(0, io.SeekStart)
assert.Nil(b, err)
dec.Reset(r)
Expand Down Expand Up @@ -250,12 +250,12 @@ func BenchmarkElementsAndAttributes(b *testing.B) {
"</bookstore>")
dec := gosaxml.NewDecoder(r)
enc := gosaxml.NewEncoder(io.Discard, gosaxml.NewNamespaceModifier())
var tk gosaxml.Token

b.ReportAllocs()
b.ResetTimer()

for i := 0; i < b.N; i++ {
var tk gosaxml.Token
_, err := r.Seek(0, io.SeekStart)
assert.Nil(b, err)
dec.Reset(r)
Expand Down

0 comments on commit 50c1c30

Please sign in to comment.