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 MylesBorins committed May 15, 2017
1 parent 2fc806e commit 9baaff7
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 9baaff7

Please sign in to comment.