MCPcopy Index your code
hub / github.com/bitfield/script / TestEachLine_HandlesLongLines

Function TestEachLine_HandlesLongLines

script_test.go:279–293  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

277}
278
279func TestEachLine_HandlesLongLines(t *testing.T) {
280 t.Parallel()
281 var got int
282 _, err := script.Echo(longLine).
283 EachLine(func(line string, out *strings.Builder) {
284 got++
285 }).String()
286 if err != nil {
287 t.Fatal(err)
288 }
289 want := 2
290 if want != got {
291 t.Errorf("want %d lines counted, got %d", want, got)
292 }
293}
294
295func TestEchoProducesSuppliedString(t *testing.T) {
296 t.Parallel()

Callers

nothing calls this directly

Calls 3

EchoFunction · 0.92
StringMethod · 0.80
EachLineMethod · 0.80

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…