mirror of
https://github.com/nodejs/node.git
synced 2025-05-05 19:08:17 +00:00

Correct alignment on variable assignments that span multiple lines in preparation for lint rule to enforce such alignment. PR-URL: https://github.com/nodejs/node/pull/6242 Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl> Reviewed-By: Johan Bergström <bugs@bergstroem.nu> Reviewed-By: James M Snell <jasnell@gmail.com>
38 lines
834 B
JavaScript
38 lines
834 B
JavaScript
'use strict';
|
|
|
|
require('../common');
|
|
const assert = require('assert');
|
|
const PassThrough = require('stream').PassThrough;
|
|
const readline = require('readline');
|
|
|
|
// Checks that tab completion still works
|
|
// when output column size is undefined
|
|
|
|
const iStream = new PassThrough();
|
|
const oStream = new PassThrough();
|
|
|
|
readline.createInterface({
|
|
terminal: true,
|
|
input: iStream,
|
|
output: oStream,
|
|
completer: function(line, cb) {
|
|
cb(null, [['process.stdout', 'process.stdin', 'process.stderr'], line]);
|
|
}
|
|
});
|
|
|
|
var output = '';
|
|
|
|
oStream.on('data', function(data) {
|
|
output += data;
|
|
});
|
|
|
|
oStream.on('end', function() {
|
|
const expect = 'process.stdout\r\n' +
|
|
'process.stdin\r\n' +
|
|
'process.stderr';
|
|
assert(new RegExp(expect).test(output));
|
|
});
|
|
|
|
iStream.write('process.std\t');
|
|
oStream.end();
|