(t *testing.T)
| 857 | } |
| 858 | |
| 859 | func 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 | |
| 872 | func TestLastHandlesLongLines(t *testing.T) { |
| 873 | t.Parallel() |