Skip to content

Commit

Permalink
test: test isFullWidthCodePoint with invalid input
Browse files Browse the repository at this point in the history
Code coverage information shows that we are only testing the happy path
for the internal readline `isFullWidthCodePoint()` function. Test it
with invalid input.
  • Loading branch information
Trott committed Jun 28, 2016
1 parent db21266 commit ae0ef11
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions test/parallel/test-readline-interface.js
Original file line number Diff line number Diff line change
Expand Up @@ -327,6 +327,9 @@ function isWarned(emitter) {
rli.close();
}

// isFullWidthCodePoint() should return false for non-numeric values
assert.strictEqual(internalReadline.isFullWidthCodePoint('あ'), false);

// wide characters should be treated as two columns.
assert.equal(internalReadline.isFullWidthCodePoint('a'.charCodeAt(0)), false);
assert.equal(internalReadline.isFullWidthCodePoint('あ'.charCodeAt(0)), true);
Expand Down

0 comments on commit ae0ef11

Please sign in to comment.