11cb0ef41Sopenharmony_ci'use strict';
21cb0ef41Sopenharmony_ci
31cb0ef41Sopenharmony_ciconst common = require('../common');
41cb0ef41Sopenharmony_ciconst ArrayStream = require('../common/arraystream');
51cb0ef41Sopenharmony_ciconst assert = require('assert');
61cb0ef41Sopenharmony_ciconst repl = require('repl');
71cb0ef41Sopenharmony_ci
81cb0ef41Sopenharmony_ciArrayStream.prototype.write = () => {};
91cb0ef41Sopenharmony_ci
101cb0ef41Sopenharmony_ciconst putIn = new ArrayStream();
111cb0ef41Sopenharmony_ciconst testMe = repl.start('', putIn);
121cb0ef41Sopenharmony_ci
131cb0ef41Sopenharmony_ci// https://github.com/nodejs/node/issues/3346
141cb0ef41Sopenharmony_ci// Tab-completion should be empty
151cb0ef41Sopenharmony_ciputIn.run(['.clear']);
161cb0ef41Sopenharmony_ciputIn.run(['function () {']);
171cb0ef41Sopenharmony_citestMe.complete('arguments.', common.mustCall((err, completions) => {
181cb0ef41Sopenharmony_ci  assert.strictEqual(err, null);
191cb0ef41Sopenharmony_ci  assert.deepStrictEqual(completions, [[], 'arguments.']);
201cb0ef41Sopenharmony_ci}));
211cb0ef41Sopenharmony_ci
221cb0ef41Sopenharmony_ciputIn.run(['.clear']);
231cb0ef41Sopenharmony_ciputIn.run(['function () {']);
241cb0ef41Sopenharmony_ciputIn.run(['undef;']);
251cb0ef41Sopenharmony_citestMe.complete('undef.', common.mustCall((err, completions) => {
261cb0ef41Sopenharmony_ci  assert.strictEqual(err, null);
271cb0ef41Sopenharmony_ci  assert.deepStrictEqual(completions, [[], 'undef.']);
281cb0ef41Sopenharmony_ci}));
29