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.

28 lines
783 B

'use strict';
const common = require('../common');
const assert = require('assert');
const repl = require('repl');
common.ArrayStream.prototype.write = common.noop;
const putIn = new common.ArrayStream();
const testMe = repl.start('', putIn);
// https://github.com/nodejs/node/issues/3346
// Tab-completion should be empty
putIn.run(['.clear']);
putIn.run(['function () {']);
testMe.complete('arguments.', common.mustCall((err, completions) => {
assert.strictEqual(err, null);
assert.deepStrictEqual(completions, [[], 'arguments.']);
}));
putIn.run(['.clear']);
putIn.run(['function () {']);
putIn.run(['undef;']);
testMe.complete('undef.', common.mustCall((err, completions) => {
assert.strictEqual(err, null);
assert.deepStrictEqual(completions, [[], 'undef.']);
}));