From 87b7b41e865c46aa484cb41cd11f02e68b49d362 Mon Sep 17 00:00:00 2001 From: Mohsin Zaidi <2236875+smrz2001@users.noreply.github.com> Date: Sun, 12 Jun 2022 15:58:23 -0400 Subject: [PATCH] align patch/amend tests --- traversal/amend/benchmarking_test.go | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/traversal/amend/benchmarking_test.go b/traversal/amend/benchmarking_test.go index 844d3d31..f17671ef 100644 --- a/traversal/amend/benchmarking_test.go +++ b/traversal/amend/benchmarking_test.go @@ -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, @@ -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, @@ -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, @@ -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, @@ -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, @@ -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,