MCPcopy
hub / github.com/bitfield/script / TestFirstHasNoEffectGivenLessThanNInputLines

Function TestFirstHasNoEffectGivenLessThanNInputLines

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

Source from the content-addressed store, hash-verified

564}
565
566func TestFirstHasNoEffectGivenLessThanNInputLines(t *testing.T) {
567 t.Parallel()
568 input := "a\nb\nc\n"
569 want := "a\nb\nc\n"
570 got, err := script.Echo(input).First(4).String()
571 if err != nil {
572 t.Fatal(err)
573 }
574 if want != got {
575 t.Error(cmp.Diff(want, got))
576 }
577}
578
579func TestFirstDoesNotConsumeUnnecessaryData(t *testing.T) {
580 t.Parallel()

Callers

nothing calls this directly

Calls 4

EchoFunction · 0.92
StringMethod · 0.80
FirstMethod · 0.80
ErrorMethod · 0.80

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…