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

Function TestLastDropsAllButLastNLinesOfInput

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

Source from the content-addressed store, hash-verified

857}
858
859func TestLastDropsAllButLastNLinesOfInput(t *testing.T) {
860 t.Parallel()
861 input := "a\nb\nc\n"
862 want := "b\nc\n"
863 got, err := script.Echo(input).Last(2).String()
864 if err != nil {
865 t.Fatal(err)
866 }
867 if want != got {
868 t.Error(cmp.Diff(want, got))
869 }
870}
871
872func TestLastHandlesLongLines(t *testing.T) {
873 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…