provisioner/shell: add another UnixReader test for sanity

This commit is contained in:
Mitchell Hashimoto 2013-09-30 11:39:24 -07:00
parent a793e03fb6
commit ff163e4459
1 changed files with 18 additions and 0 deletions

View File

@ -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())
}
}