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

Function TestLastHandlesLongLines

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

Source from the content-addressed store, hash-verified

870}
871
872func TestLastHandlesLongLines(t *testing.T) {
873 t.Parallel()
874 want := "last line\n"
875 got, err := script.Echo(longLine).Last(1).String()
876 if err != nil {
877 t.Fatal(err)
878 }
879 if want != got {
880 t.Error(cmp.Diff(want, got))
881 }
882}
883
884func TestLastHasNoOutputWhenNIs0(t *testing.T) {
885 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…