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 <jasnell@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Rich Trott <rtrott@gmail.com>
  • Loading branch information
orisano authored and jasnell committed Apr 13, 2017
1 parent a4125a3 commit 05a00a0
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 @@ -34,6 +34,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 @@ -45,6 +46,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 05a00a0

Please sign in to comment.