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: nodejs/node#12354
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Rich Trott <rtrott@gmail.com>
  • Loading branch information
orisano authored and andrew749 committed Jul 19, 2017
1 parent 8fd5c73 commit 1ff4134
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 1ff4134

Please sign in to comment.