(t *testing.T)
| 551 | } |
| 552 | |
| 553 | func TestFirstHasNoOutputWhenNIsNegative(t *testing.T) { |
| 554 | t.Parallel() |
| 555 | input := "a\nb\nc\n" |
| 556 | want := "" |
| 557 | got, err := script.Echo(input).First(-1).String() |
| 558 | if err != nil { |
| 559 | t.Fatal(err) |
| 560 | } |
| 561 | if want != got { |
| 562 | t.Error(cmp.Diff(want, got)) |
| 563 | } |
| 564 | } |
| 565 | |
| 566 | func TestFirstHasNoEffectGivenLessThanNInputLines(t *testing.T) { |
| 567 | t.Parallel() |