diff options
author | Sebastian Van Sande <sebastian@vansande.org> | 2017-02-03 13:11:46 +0100 |
---|---|---|
committer | James M Snell <jasnell@gmail.com> | 2017-02-13 11:30:43 -0800 |
commit | c6238e2761e9ba5c35aa4842c9be2ae937d28998 (patch) | |
tree | c67efca03981ad523d9bd904ee0e2b2b1c01a7a7 /test | |
parent | 9f74184e98020eb71060ee38c2b3d649ad299bb6 (diff) | |
download | android-node-v8-c6238e2761e9ba5c35aa4842c9be2ae937d28998.tar.gz android-node-v8-c6238e2761e9ba5c35aa4842c9be2ae937d28998.tar.bz2 android-node-v8-c6238e2761e9ba5c35aa4842c9be2ae937d28998.zip |
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>
Diffstat (limited to 'test')
-rw-r--r-- | test/parallel/test-punycode.js | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/test/parallel/test-punycode.js b/test/parallel/test-punycode.js index 6017555704..b95d33fdb2 100644 --- a/test/parallel/test-punycode.js +++ b/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'); |