Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 63dc221

Browse filesBrowse files
Aivo PaasMylesBorins
authored andcommitted
test: add test case for completion bash flag
This test case verifies that starting Node.js with the completion bash flag prints out the expected result and ends right after. PR-URL: #24168 Reviewed-By: Bryan English <bryan@bryanenglish.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
1 parent dd67f39 commit 63dc221
Copy full SHA for 63dc221

File tree

Expand file treeCollapse file tree

1 file changed

+23
-0
lines changed
Open diff view settings
Filter options
Expand file treeCollapse file tree

1 file changed

+23
-0
lines changed
Open diff view settings
Collapse file
+23Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
'use strict';
2+
require('../common');
3+
const assert = require('assert');
4+
const child_process = require('child_process');
5+
6+
const p = child_process.spawnSync(
7+
process.execPath, [ '--completion-bash' ]);
8+
assert.ifError(p.error);
9+
assert.ok(p.stdout.toString().includes(
10+
`_node_complete() {
11+
local cur_word options
12+
cur_word="\${COMP_WORDS[COMP_CWORD]}"
13+
if [[ "\${cur_word}" == -* ]] ; then
14+
COMPREPLY=( $(compgen -W '`));
15+
assert.ok(p.stdout.toString().includes(
16+
`' -- "\${cur_word}") )
17+
return 0
18+
else
19+
COMPREPLY=( $(compgen -f "\${cur_word}") )
20+
return 0
21+
fi
22+
}
23+
complete -F _node_complete node node_g`));

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.