diff --git a/types/views/views_test.go b/types/views/views_test.go index 5b3f07733..e3d5cbda9 100644 --- a/types/views/views_test.go +++ b/types/views/views_test.go @@ -151,6 +151,15 @@ func TestLenIter(t *testing.T) { if !reflect.DeepEqual(orig, got) { t.Errorf("got %q; want %q", got, orig) } + x := 0 + n := testing.AllocsPerRun(10000, func() { + for range v.LenIter() { + x++ + } + }) + if n > 0 { + t.Errorf("allocs = %v; want 0", n) + } } func TestSliceEqual(t *testing.T) {