mirror of https://github.com/nealey/spongy
Unit test passing
This commit is contained in:
parent
29a9268df8
commit
28e90f7d3a
|
@ -12,7 +12,7 @@ func TestRWCWCat(t *testing.T) {
|
||||||
}
|
}
|
||||||
|
|
||||||
out := []byte("Hello, World\n")
|
out := []byte("Hello, World\n")
|
||||||
p := make([]byte, 0, 50)
|
p := make([]byte, 50)
|
||||||
|
|
||||||
n, err := proc.Write(out)
|
n, err := proc.Write(out)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
@ -29,7 +29,7 @@ func TestRWCWCat(t *testing.T) {
|
||||||
if n != len(out) {
|
if n != len(out) {
|
||||||
t.Errorf("Wrong number of bytes in Read: wanted %d, got %d", len(out), n)
|
t.Errorf("Wrong number of bytes in Read: wanted %d, got %d", len(out), n)
|
||||||
}
|
}
|
||||||
if 0 != bytes.Compare(p, out) {
|
if 0 != bytes.Compare(p[:n], out) {
|
||||||
t.Errorf("Mangled read")
|
t.Errorf("Mangled read")
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue