Skip to content

Commit

Permalink
test: add readline test for escape sequence
Browse files Browse the repository at this point in the history
Tests do not cover a small piece of code in
lib/internal/readline/utils.js for consuming an escape sequence.
This adds a minimal test to cover the code.

Refs: https://coverage.nodejs.org/coverage-0848f56cb3943209/lib/internal/readline/utils.js.html#L327

PR-URL: #34952
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
Reviewed-By: Gerhard Stöbich <deb2001-github@yahoo.de>
  • Loading branch information
Trott committed Aug 30, 2020
1 parent 4fa439c commit 5c02076
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions test/parallel/test-readline-keys.js
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,9 @@ addTest('\x1b\x1b\x1b', [
{ name: 'escape', sequence: '\x1b\x1b\x1b', meta: true },
]);

// Escape sequence
addTest('\x1b]', [{ name: undefined, sequence: '\x1B]', meta: true }]);

// Control keys
addTest('\x01\x0b\x10', [
{ name: 'a', sequence: '\x01', ctrl: true },
Expand Down

0 comments on commit 5c02076

Please sign in to comment.