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 authored and richardlau committed Sep 1, 2020
1 parent 75d1612 commit 9057a16
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions test/parallel/test-readline-keys.js
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 9057a16

Please sign in to comment.