@@ -2,10 +2,9 @@ package mexpr
22
33import (
44 "encoding/json"
5+ "reflect"
56 "strings"
67 "testing"
7-
8- "github.com/stretchr/testify/assert"
98)
109
1110func TestInterpreter (t * testing.T ) {
@@ -224,7 +223,9 @@ func TestInterpreter(t *testing.T) {
224223 if err != nil {
225224 t .Fatal (err .Pretty (tc .expr ))
226225 }
227- assert .Equal (t , tc .output , result )
226+ if ! reflect .DeepEqual (tc .output , result ) {
227+ t .Fatalf ("expected %v but found %v" , tc .output , result )
228+ }
228229 }
229230 })
230231 }
@@ -283,7 +284,9 @@ func Benchmark(b *testing.B) {
283284 ast , _ := Parse (bm .mexpr , input )
284285 r , _ = Run (ast , input , StrictMode )
285286 }
286- assert .Equal (b , bm .result , r )
287+ if ! reflect .DeepEqual (bm .result , r ) {
288+ b .Fatalf ("expected %v but found %v" , bm .result , r )
289+ }
287290 })
288291
289292 // b.Run(" expr-"+bm.name+"-slow", func(b *testing.B) {
@@ -299,13 +302,17 @@ func Benchmark(b *testing.B) {
299302 b .Run ("mexpr-" + bm .name + "-cached" , func (b * testing.B ) {
300303 b .ReportAllocs ()
301304 ast , err := Parse (bm .mexpr , input )
302- assert .NoError (b , err )
305+ if err != nil {
306+ b .Fatal (err )
307+ }
303308 i := NewInterpreter (ast )
304309 b .ResetTimer ()
305310 for n := 0 ; n < b .N ; n ++ {
306311 r , _ = i .Run (input )
307312 }
308- assert .Equal (b , bm .result , r )
313+ if ! reflect .DeepEqual (bm .result , r ) {
314+ b .Fatalf ("expected %v but found %v" , bm .result , r )
315+ }
309316 })
310317
311318 // b.Run(" expr-"+bm.name+"-cached", func(b *testing.B) {
0 commit comments