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 e3097b7

Browse filesBrowse files
TrottMyles Borins
authored andcommitted
test: test isFullWidthCodePoint with invalid input
Code coverage information shows that we are only testing the happy path for the internal readline `isFullWidthCodePoint()` function. Test it with invalid input. PR-URL: #7422 Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Brian White <mscdex@mscdex.net> Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl> Reviewed-By: James M Snell <jasnell@gmail.com>
1 parent f0b0fc4 commit e3097b7
Copy full SHA for e3097b7

File tree

Expand file treeCollapse file tree

1 file changed

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

1 file changed

+5
-0
lines changed
Open diff view settings
Collapse file

‎test/parallel/test-readline-interface.js‎

Copy file name to clipboardExpand all lines: test/parallel/test-readline-interface.js
+5Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -304,6 +304,11 @@ function isWarned(emitter) {
304304
rli.close();
305305
}
306306

307+
// isFullWidthCodePoint() should return false for non-numeric values
308+
[true, false, null, undefined, {}, [], 'あ'].forEach((v) => {
309+
assert.strictEqual(readline.isFullWidthCodePoint('あ'), false);
310+
});
311+
307312
// wide characters should be treated as two columns.
308313
assert.equal(readline.isFullWidthCodePoint('a'.charCodeAt(0)), false);
309314
assert.equal(readline.isFullWidthCodePoint('あ'.charCodeAt(0)), true);

0 commit comments

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