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

Function TestFirstHasNoOutputWhenNIsNegative

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

Source from the content-addressed store, hash-verified

551}
552
553func TestFirstHasNoOutputWhenNIsNegative(t *testing.T) {
554 t.Parallel()
555 input := "a\nb\nc\n"
556 want := ""
557 got, err := script.Echo(input).First(-1).String()
558 if err != nil {
559 t.Fatal(err)
560 }
561 if want != got {
562 t.Error(cmp.Diff(want, got))
563 }
564}
565
566func TestFirstHasNoEffectGivenLessThanNInputLines(t *testing.T) {
567 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…