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.

39 lines
807 B

'use strict';
14 years ago
var common = require('../common');
var assert = require('assert');
var net = require('net');
var fs = require('fs');
var util = require('util');
var path = require('path');
14 years ago
var fn = path.join(common.fixturesDir, 'elipses.txt');
15 years ago
14 years ago
var expected = fs.readFileSync(fn, 'utf8');
15 years ago
14 years ago
var server = net.createServer(function(stream) {
util.pump(fs.createReadStream(fn), stream, function() {
15 years ago
server.close();
});
});
14 years ago
server.listen(common.PORT, function() {
14 years ago
var conn = net.createConnection(common.PORT);
15 years ago
conn.setEncoding('utf8');
conn.on('data', function(chunk) {
15 years ago
buffer += chunk;
});
conn.on('end', function() {
15 years ago
conn.end();
});
});
var buffer = '';
14 years ago
var count = 0;
15 years ago
server.on('listening', function() {
15 years ago
});
process.on('exit', function() {
15 years ago
assert.equal(expected, buffer);
});