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

Function TestLastHasNoOutputWhenNIsNegative

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

Source from the content-addressed store, hash-verified

895}
896
897func TestLastHasNoOutputWhenNIsNegative(t *testing.T) {
898 t.Parallel()
899 input := "a\nb\nc\n"
900 want := ""
901 got, err := script.Echo(input).Last(-1).String()
902 if err != nil {
903 t.Fatal(err)
904 }
905 if want != got {
906 t.Error(cmp.Diff(want, got))
907 }
908}
909
910func TestLastHasNoEffectGivenLessThanNInputLines(t *testing.T) {
911 t.Parallel()

Callers

nothing calls this directly

Calls 4

EchoFunction · 0.92
StringMethod · 0.80
LastMethod · 0.80
ErrorMethod · 0.80

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…