(t *testing.T)
| 908 | } |
| 909 | |
| 910 | func 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 | |
| 923 | func TestMatchOutputsOnlyMatchingLinesOfInput(t *testing.T) { |
| 924 | t.Parallel() |