Permalink
Browse files

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.

PR-URL: #11144
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Sakthipriyan Vairamani <thechargingvolcano@gmail.com>
  • Loading branch information...
seppevs authored and italoacasas committed Feb 3, 2017
1 parent 68eb974 commit 6f866ae0020099c36ba9377cbbc8f8a836899d06
Showing with 6 additions and 0 deletions.
  1. +6 −0 test/parallel/test-punycode.js
@@ -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');

0 comments on commit 6f866ae

Please sign in to comment.