mirror of
https://github.com/hashicorp/packer.git
synced 2026-09-24 00:41:41 -04:00
provisioner/shell: add another UnixReader test for sanity
This commit is contained in:
@@ -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())
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user