Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
test: improve punycode test coverage
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.
  • Loading branch information
seppevs committed Feb 3, 2017
commit 3b05c2b5fc4cd150a1fe5f421781e370ce85f712
6 changes: 6 additions & 0 deletions test/parallel/test-punycode.js
Original file line number Diff line number Diff line change
Expand Up @@ -237,3 +237,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');