Skip to content

Commit

Permalink
test: improve punycode coverage to check surrogate pair
Browse files Browse the repository at this point in the history
PR-URL: #12354
Reviewed-By: James M Snell <[email protected]>
Reviewed-By: Colin Ihrig <[email protected]>
Reviewed-By: Rich Trott <[email protected]>
  • Loading branch information
orisano authored and evanlucas committed May 2, 2017
1 parent ed13016 commit aff0cfc
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions test/parallel/test-punycode.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ assert.strictEqual(
'Willst du die Blthe des frhen, die Frchte des spteren Jahres-x9e96lkal'
);
assert.strictEqual(punycode.encode('日本語'), 'wgv71a119e');
assert.strictEqual(punycode.encode('𩸽'), 'x73l');

assert.strictEqual(punycode.decode('tda'), 'ü');
assert.strictEqual(punycode.decode('Goethe-'), 'Goethe');
Expand All @@ -24,6 +25,7 @@ assert.strictEqual(
'Willst du die Blüthe des frühen, die Früchte des späteren Jahres'
);
assert.strictEqual(punycode.decode('wgv71a119e'), '日本語');
assert.strictEqual(punycode.decode('x73l'), '𩸽');
assert.throws(() => {
punycode.decode(' ');
}, /^RangeError: Invalid input$/);
Expand Down

0 comments on commit aff0cfc

Please sign in to comment.