Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/nodejs/node.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorRuben Bridgewater <ruben@bridgewater.de>2019-12-18 21:58:49 +0300
committerRuben Bridgewater <ruben@bridgewater.de>2019-12-25 13:17:31 +0300
commitb45eeee01741013c4a37887817c71b779d9edb12 (patch)
treedcfe7421be9f9e98513167d08f91737b2542afba /test
parentb768e84794604b2a7d7e004e6fe838145b80098c (diff)
readline: set null as callback return in case there's no error
The cursor move functions accept a callback. It was possible that `undefined` was returned in case there was no error instead of null. PR-URL: https://github.com/nodejs/node/pull/31006 Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com> Reviewed-By: Anto Aravinth <anto.aravinth.cse@gmail.com> Reviewed-By: Rich Trott <rtrott@gmail.com>
Diffstat (limited to 'test')
-rw-r--r--test/parallel/test-readline-csi.js16
1 files changed, 12 insertions, 4 deletions
diff --git a/test/parallel/test-readline-csi.js b/test/parallel/test-readline-csi.js
index 53b07d7bd93..346f1cbad12 100644
--- a/test/parallel/test-readline-csi.js
+++ b/test/parallel/test-readline-csi.js
@@ -39,7 +39,9 @@ assert.throws(() => {
}, /ERR_INVALID_CALLBACK/);
// Verify that clearScreenDown() does not throw on null or undefined stream.
-assert.strictEqual(readline.clearScreenDown(null, common.mustCall()), true);
+assert.strictEqual(readline.clearScreenDown(null, common.mustCall((err) => {
+ assert.strictEqual(err, null);
+})), true);
assert.strictEqual(readline.clearScreenDown(undefined, common.mustCall()),
true);
@@ -67,7 +69,9 @@ assert.throws(() => {
// Verify that clearLine() does not throw on null or undefined stream.
assert.strictEqual(readline.clearLine(null, 0), true);
assert.strictEqual(readline.clearLine(undefined, 0), true);
-assert.strictEqual(readline.clearLine(null, 0, common.mustCall()), true);
+assert.strictEqual(readline.clearLine(null, 0, common.mustCall((err) => {
+ assert.strictEqual(err, null);
+})), true);
assert.strictEqual(readline.clearLine(undefined, 0, common.mustCall()), true);
// Nothing is written when moveCursor 0, 0
@@ -101,7 +105,9 @@ assert.throws(() => {
// Verify that moveCursor() does not throw on null or undefined stream.
assert.strictEqual(readline.moveCursor(null, 1, 1), true);
assert.strictEqual(readline.moveCursor(undefined, 1, 1), true);
-assert.strictEqual(readline.moveCursor(null, 1, 1, common.mustCall()), true);
+assert.strictEqual(readline.moveCursor(null, 1, 1, common.mustCall((err) => {
+ assert.strictEqual(err, null);
+})), true);
assert.strictEqual(readline.moveCursor(undefined, 1, 1, common.mustCall()),
true);
@@ -109,7 +115,9 @@ assert.strictEqual(readline.moveCursor(undefined, 1, 1, common.mustCall()),
assert.strictEqual(readline.cursorTo(null), true);
assert.strictEqual(readline.cursorTo(), true);
assert.strictEqual(readline.cursorTo(null, 1, 1, common.mustCall()), true);
-assert.strictEqual(readline.cursorTo(undefined, 1, 1, common.mustCall()), true);
+assert.strictEqual(readline.cursorTo(undefined, 1, 1, common.mustCall((err) => {
+ assert.strictEqual(err, null);
+})), true);
writable.data = '';
assert.strictEqual(readline.cursorTo(writable, 'a'), true);