Skip to content

Commit

Permalink
align patch/amend tests
Browse files Browse the repository at this point in the history
  • Loading branch information
smrz2001 committed Jun 12, 2022
1 parent 6df354b commit 87b7b41
Showing 1 changed file with 12 additions and 6 deletions.
18 changes: 12 additions & 6 deletions traversal/amend/benchmarking_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,8 @@ func BenchmarkAmend_Map_Add(b *testing.B) {
})
var err error
for r := 0; r < b.N; r++ {
a := NewAmender(n)
tn := n
a := NewAmender(tn)
for i := 0; i < v.num; i++ {
err = EvalOne(a, patch.Operation{
Op: patch.Op_Add,
Expand Down Expand Up @@ -138,7 +139,8 @@ func BenchmarkAmend_List_Add(b *testing.B) {
})
var err error
for r := 0; r < b.N; r++ {
a := NewAmender(n)
tn := n
a := NewAmender(tn)
for i := 0; i < v.num; i++ {
err = EvalOne(a, patch.Operation{
Op: patch.Op_Add,
Expand Down Expand Up @@ -206,7 +208,8 @@ func BenchmarkAmend_Map_Remove(b *testing.B) {
})
var err error
for r := 0; r < b.N; r++ {
a := NewAmender(n)
tn := n
a := NewAmender(tn)
for i := 0; i < v.num; i++ {
err = EvalOne(a, patch.Operation{
Op: patch.Op_Remove,
Expand Down Expand Up @@ -272,7 +275,8 @@ func BenchmarkAmend_List_Remove(b *testing.B) {
})
var err error
for r := 0; r < b.N; r++ {
a := NewAmender(n)
tn := n
a := NewAmender(tn)
for i := 0; i < v.num; i++ {
err = EvalOne(a, patch.Operation{
Op: patch.Op_Remove,
Expand Down Expand Up @@ -340,7 +344,8 @@ func BenchmarkAmend_Map_Replace(b *testing.B) {
})
var err error
for r := 0; r < b.N; r++ {
a := NewAmender(n)
tn := n
a := NewAmender(tn)
for i := 0; i < v.num; i++ {
err = EvalOne(a, patch.Operation{
Op: patch.Op_Replace,
Expand Down Expand Up @@ -408,7 +413,8 @@ func BenchmarkAmend_List_Replace(b *testing.B) {
})
var err error
for r := 0; r < b.N; r++ {
a := NewAmender(n)
tn := n
a := NewAmender(tn)
for i := 0; i < v.num; i++ {
err = EvalOne(a, patch.Operation{
Op: patch.Op_Replace,
Expand Down

0 comments on commit 87b7b41

Please sign in to comment.