diff --git a/provisioner/shell/unix_reader_test.go b/provisioner/shell/unix_reader_test.go index 8dedf6300..17e16ae39 100644 --- a/provisioner/shell/unix_reader_test.go +++ b/provisioner/shell/unix_reader_test.go @@ -31,3 +31,21 @@ func TestUnixReader(t *testing.T) { t.Fatalf("bad: %#v", result.String()) } } + +func TestUnixReader_unixOnly(t *testing.T) { + input := "one\ntwo\nthree\n" + expected := "one\ntwo\nthree\n" + + r := &UnixReader{ + Reader: bytes.NewReader([]byte(input)), + } + + result := new(bytes.Buffer) + if _, err := io.Copy(result, r); err != nil { + t.Fatalf("err: %s", err) + } + + if result.String() != expected { + t.Fatalf("bad: %#v", result.String()) + } +}