diff --git a/test/parallel/test-punycode.js b/test/parallel/test-punycode.js index f895e2fc0e2607..60175557042ff9 100644 --- a/test/parallel/test-punycode.js +++ b/test/parallel/test-punycode.js @@ -24,6 +24,15 @@ assert.strictEqual( 'Willst du die Blüthe des frühen, die Früchte des späteren Jahres' ); assert.strictEqual(punycode.decode('wgv71a119e'), '日本語'); +assert.throws(() => { + punycode.decode(' '); +}, /^RangeError: Invalid input$/); +assert.throws(() => { + punycode.decode('α-'); +}, /^RangeError: Illegal input >= 0x80 \(not a basic code point\)$/); +assert.throws(() => { + punycode.decode('あ'); +}, /^RangeError: Overflow: input needs wider integers to process$/); // http://tools.ietf.org/html/rfc3492#section-7.1 const tests = [