mirror of
https://github.com/golang/go
synced 2024-11-17 12:04:43 -07:00
io: add ErrBadWriteCount
Change-Id: I04aebbaeb504f3b856b351bb924b1bce9a015083
This commit is contained in:
parent
838d6bac72
commit
19cbb1461c
@ -431,7 +431,7 @@ func TestSectionReader_Size(t *testing.T) {
|
||||
}
|
||||
|
||||
// largeWriter returns an invalid count that is larger than the number
|
||||
// of bytes requested (issue 39978).
|
||||
// of bytes provided (issue 39978).
|
||||
type largeWriter struct {
|
||||
err error
|
||||
}
|
||||
@ -446,16 +446,14 @@ func TestCopyLargeWriter(t *testing.T) {
|
||||
wb := largeWriter{}
|
||||
rb.WriteString("hello, world.")
|
||||
if _, err := Copy(wb, rb); err != want {
|
||||
t.Errorf("Copy Error: got %v, want %v", err, want)
|
||||
}
|
||||
t.Errorf("Copy error: got %v, want %v", err, want)
|
||||
}
|
||||
|
||||
func TestCopyLargeWriterError(t *testing.T) {
|
||||
want := errors.New("largerWriteError")
|
||||
rb := new(Buffer)
|
||||
wb := largeWriter{err: want}
|
||||
want = errors.New("largeWriterError")
|
||||
rb = new(Buffer)
|
||||
wb = largeWriter{err: want}
|
||||
rb.WriteString("hello, world.")
|
||||
if _, err := Copy(wb, rb); err != want {
|
||||
t.Errorf("Copy Error: got %v, want %v", err, want)
|
||||
t.Errorf("Copy error: got %v, want %v", err, want)
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user