The copyright and license notice is already in the LICENSE file. There is no justifiable reason to also require that it be included in every file, since the individual files are not individually distributed except as part of the entire package.
31 lines
615 B
JavaScript
31 lines
615 B
JavaScript
var common = require('../common.js');
|
|
var R = require('_stream_readable');
|
|
var assert = require('assert');
|
|
|
|
var util = require('util');
|
|
var EE = require('events').EventEmitter;
|
|
|
|
var ondataCalled = 0;
|
|
|
|
function TestReader() {
|
|
R.apply(this);
|
|
this._buffer = new Buffer(100);
|
|
this._buffer.fill('x');
|
|
|
|
this.on('data', function() {
|
|
ondataCalled++;
|
|
});
|
|
}
|
|
|
|
util.inherits(TestReader, R);
|
|
|
|
TestReader.prototype._read = function(n) {
|
|
this.push(this._buffer);
|
|
this._buffer = new Buffer(0);
|
|
};
|
|
|
|
var reader = new TestReader();
|
|
setImmediate(function() {
|
|
assert.equal(ondataCalled, 1);
|
|
console.log('ok');
|
|
});
|