diff options
author | zhangyongsheng <zhangyongsheng@youzan.com> | 2019-09-16 17:08:18 +0800 |
---|---|---|
committer | zhangyongsheng <zhangyongsheng@youzan.com> | 2019-09-18 09:58:59 +0800 |
commit | 2f497a67ad8797e89944d484b2e156fc1d6652f3 (patch) | |
tree | 834c6feaaab3769c6427982171e11045d723e7d6 /test | |
parent | 3f3ad38c878e2acdd36f724542c9aecd8b4474e9 (diff) | |
download | android-node-v8-2f497a67ad8797e89944d484b2e156fc1d6652f3.tar.gz android-node-v8-2f497a67ad8797e89944d484b2e156fc1d6652f3.tar.bz2 android-node-v8-2f497a67ad8797e89944d484b2e156fc1d6652f3.zip |
repl: fix bug in fs module autocompletion
PR-URL: https://github.com/nodejs/node/pull/29555
Fixes: https://github.com/nodejs/node/issues/29424
Reviewed-By: Anto Aravinth <anto.aravinth.cse@gmail.com>
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
Diffstat (limited to 'test')
-rw-r--r-- | test/parallel/test-repl-tab-complete.js | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/test/parallel/test-repl-tab-complete.js b/test/parallel/test-repl-tab-complete.js index 5c1936b3f5..1c66f9a323 100644 --- a/test/parallel/test-repl-tab-complete.js +++ b/test/parallel/test-repl-tab-complete.js @@ -28,6 +28,7 @@ const { restoreStderr } = require('../common/hijackstdio'); const assert = require('assert'); +const path = require('path'); const fixtures = require('../common/fixtures'); const hasInspector = process.features.inspector; @@ -434,6 +435,16 @@ testMe.complete('obj.', common.mustCall((error, data) => { assert.strictEqual(data[0].length, 0); }) ); + + const testPath = fixturePath.slice(0, -1); + testMe.complete(testPath, common.mustCall((err, data) => { + assert.strictEqual(err, null); + assert.ok(data[0][0].includes('test-repl-tab-completion')); + assert.strictEqual( + data[1], + path.basename(testPath) + ); + })); }); } } |