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

Function TestLastHasNoEffectGivenLessThanNInputLines

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

Source from the content-addressed store, hash-verified

908}
909
910func TestLastHasNoEffectGivenLessThanNInputLines(t *testing.T) {
911 t.Parallel()
912 input := "a\nb\nc\n"
913 want := "a\nb\nc\n"
914 got, err := script.Echo(input).Last(4).String()
915 if err != nil {
916 t.Fatal(err)
917 }
918 if want != got {
919 t.Error(cmp.Diff(want, got))
920 }
921}
922
923func TestMatchOutputsOnlyMatchingLinesOfInput(t *testing.T) {
924 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…