Commit 89d165aa authored by Mitchell Hashimoto's avatar Mitchell Hashimoto

provisioner/shell: add another UnixReader test for sanity

parent 38d3411f
...@@ -31,3 +31,21 @@ func TestUnixReader(t *testing.T) { ...@@ -31,3 +31,21 @@ func TestUnixReader(t *testing.T) {
t.Fatalf("bad: %#v", result.String()) 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())
}
}
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment