Skip to content

Commit

Permalink
test: improve punycode test coverage
Browse files Browse the repository at this point in the history
Adds two additional tests for mapDomain function in punycode.js.
When an email address is given to the toASCII() and toUnicode()
functions, only the parts before the '@' character should be
encoded/decoded.

PR-URL: #11144
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Sakthipriyan Vairamani <thechargingvolcano@gmail.com>
  • Loading branch information
seppevs authored and MylesBorins committed Mar 9, 2017
1 parent 8db3c77 commit c539325
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions test/parallel/test-punycode.js
Original file line number Diff line number Diff line change
Expand Up @@ -222,3 +222,9 @@ assert.strictEqual(punycode.ucs2.encode([0xDC00]), '\uDC00');
assert.strictEqual(punycode.ucs2.encode([0xDC00, 0x61, 0x62]), '\uDC00ab');

assert.strictEqual(errors, 0);

// test map domain
assert.strictEqual(punycode.toASCII('Bücher@日本語.com'),
'Bücher@xn--wgv71a119e.com');
assert.strictEqual(punycode.toUnicode('Bücher@xn--wgv71a119e.com'),
'Bücher@日本語.com');

0 comments on commit c539325

Please sign in to comment.