From 70a19bdce805fcc321978a44630fd68cf1dc49cd Mon Sep 17 00:00:00 2001 From: Ben Johnson Date: Wed, 6 Mar 2019 09:07:50 -0700 Subject: Remove go-cmp dependency --- immutable_test.go | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) (limited to 'immutable_test.go') diff --git a/immutable_test.go b/immutable_test.go index 1512e93..ca2393b 100644 --- a/immutable_test.go +++ b/immutable_test.go @@ -6,8 +6,6 @@ import ( "math/rand" "sort" "testing" - - "github.com/google/go-cmp/cmp" ) var ( @@ -1334,8 +1332,13 @@ func (m *TMap) validateIterator(mm *Map) error { k, v := itr.Next() other[k.(int)] = v.(int) } - if diff := cmp.Diff(other, m.std); diff != "" { - return fmt.Errorf("map iterator mismatch: %s", diff) + if len(other) != len(m.std) { + return fmt.Errorf("map iterator size mismatch: %v!=%v", len(m.std), len(other)) + } + for k, v := range m.std { + if v != other[k] { + return fmt.Errorf("map iterator mismatch: key=%v, %v!=%v", k, v, other[k]) + } } if k, v := itr.Next(); k != nil || v != nil { return fmt.Errorf("map iterator returned key/value after done: <%v/%v>", k, v) -- cgit v1.2.3