Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
test('read(0) for ended streams', function (t) {
var r = new R();
var written = false;
var ended = false;
r._read = function () {};
r.push(new Buffer("foo"));
var v =;
assert.equal(v, null);
console.log("v", v);
var w = new R();
w.write = function (buffer) {
written = true;
assert.equal(ended, false);
assert.equal(buffer.toString(), "foo")
w.end = function () {
ended = true;
// FAIL ended before written
assert.equal(written, true);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.