Skip to content

Commit c539325

Browse files
seppevsMylesBorins
authored andcommitted
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 <[email protected]> Reviewed-By: Sakthipriyan Vairamani <[email protected]>
1 parent 8db3c77 commit c539325

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

test/parallel/test-punycode.js

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -222,3 +222,9 @@ assert.strictEqual(punycode.ucs2.encode([0xDC00]), '\uDC00');
222222
assert.strictEqual(punycode.ucs2.encode([0xDC00, 0x61, 0x62]), '\uDC00ab');
223223

224224
assert.strictEqual(errors, 0);
225+
226+
// test map domain
227+
assert.strictEqual(punycode.toASCII('Bücher@日本語.com'),
228+
229+
assert.strictEqual(punycode.toUnicode('Bü[email protected]'),
230+
'Bücher@日本語.com');

0 commit comments

Comments
 (0)