From 3fd7889e30d6263f56797009c7df0230c8dce0fa Mon Sep 17 00:00:00 2001 From: Rich Trott Date: Thu, 27 Aug 2020 21:06:41 -0700 Subject: [PATCH] test: add readline test for escape sequence MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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: https://github.com/nodejs/node/pull/34952 Reviewed-By: Benjamin Gruenbaum Reviewed-By: Gerhard Stöbich --- test/parallel/test-readline-keys.js | 3 +++ 1 file changed, 3 insertions(+) diff --git a/test/parallel/test-readline-keys.js b/test/parallel/test-readline-keys.js index 0f5ca4d71443fd..f0162ab06b8f38 100644 --- a/test/parallel/test-readline-keys.js +++ b/test/parallel/test-readline-keys.js @@ -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 },