(t *testing.T)
| 882 | } |
| 883 | |
| 884 | func 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 | |
| 897 | func TestLastHasNoOutputWhenNIsNegative(t *testing.T) { |
| 898 | t.Parallel() |