MCPcopy Index your code
hub / github.com/bitfield/script / TestLastHasNoOutputWhenNIs0

Function TestLastHasNoOutputWhenNIs0

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

Source from the content-addressed store, hash-verified

882}
883
884func TestLastHasNoOutputWhenNIs0(t *testing.T) {
885 t.Parallel()
886 input := "a\nb\nc\n"
887 want := ""
888 got, err := script.Echo(input).Last(0).String()
889 if err != nil {
890 t.Fatal(err)
891 }
892 if want != got {
893 t.Error(cmp.Diff(want, got))
894 }
895}
896
897func TestLastHasNoOutputWhenNIsNegative(t *testing.T) {
898 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…