mirror of
https://github.com/nodejs/node.git
synced 2026-11-27 17:52:27 -05:00
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: https://github.com/nodejs/node/pull/11144 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Sakthipriyan Vairamani <thechargingvolcano@gmail.com>
This commit is contained in:
1 parent
68eb97442d
commit
6f866ae002
1 file changed
+6
@@ -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');
|
||||
Reference in new issue
Block a user