mirror of https://github.com/lukechilds/node.git
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
29 lines
520 B
29 lines
520 B
'use strict';
|
|
require('../common');
|
|
const stream = require('stream');
|
|
const assert = require('assert');
|
|
const util = require('util');
|
|
|
|
function Writable() {
|
|
this.writable = true;
|
|
stream.Stream.call(this);
|
|
}
|
|
util.inherits(Writable, stream.Stream);
|
|
|
|
function Readable() {
|
|
this.readable = true;
|
|
stream.Stream.call(this);
|
|
}
|
|
util.inherits(Readable, stream.Stream);
|
|
|
|
var passed = false;
|
|
|
|
var w = new Writable();
|
|
w.on('pipe', function(src) {
|
|
passed = true;
|
|
});
|
|
|
|
var r = new Readable();
|
|
r.pipe(w);
|
|
|
|
assert.ok(passed);
|
|
|