add test for Buffer edge case

This commit is contained in:
Bartek Iwańczuk 2018-11-27 21:46:24 +01:00 committed by Ryan Dahl
parent 9ca92bd51b
commit b183b01c8e
2 changed files with 11 additions and 2 deletions

View file

@ -132,8 +132,7 @@ export class Buffer implements Reader, Writer {
// Buffer is empty, reset to recover space.
this.reset();
if (p.byteLength === 0) {
// TODO This edge case should be tested by porting TestReadEmptyAtEOF
// from the Go tests.
// this edge case is tested in 'bufferReadEmptyAtEOF' test
return { nread: 0, eof: false };
}
return { nread: 0, eof: true };