Skip to content

Commit 6f866ae

Browse files
seppevsitaloacasas
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 68eb974 commit 6f866ae

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

test/parallel/test-punycode.js

+6
Original file line numberDiff line numberDiff line change
@@ -237,3 +237,9 @@ assert.strictEqual(punycode.ucs2.encode([0xDC00]), '\uDC00');
237237
assert.strictEqual(punycode.ucs2.encode([0xDC00, 0x61, 0x62]), '\uDC00ab');
238238

239239
assert.strictEqual(errors, 0);
240+
241+
// test map domain
242+
assert.strictEqual(punycode.toASCII('Bücher@日本語.com'),
243+
244+
assert.strictEqual(punycode.toUnicode('Bü[email protected]'),
245+
'Bücher@日本語.com');

0 commit comments

Comments
 (0)