| // Copyright 2019 The Go Authors. All rights reserved. |
| // Use of this source code is governed by a BSD-style |
| // license that can be found in the LICENSE file. |
| "golang.org/x/build/internal/foreach" |
| foreach.Line(v, func(b []byte) error { |
| // "after two blank lines" |
| func TestLineAllocs(t *testing.T) { |
| v := bytes.Repeat([]byte(`waefaweflk |
| allocs := testing.AllocsPerRun(1000, func() { |
| foreach.Line(v, func([]byte) error { return nil }) |
| t.Errorf("got allocs = %v; want zero", allocs) |
| func TestLineStrAllocs(t *testing.T) { |
| s := strings.Repeat(`waefaweflk |
| allocs := testing.AllocsPerRun(1000, func() { |
| foreach.LineStr(s, func(string) error { return nil }) |
| t.Errorf("got allocs = %v; want zero", allocs) |