summaryrefslogtreecommitdiff
path: root/test/simple/test-punycode.js
diff options
context:
space:
mode:
Diffstat (limited to 'test/simple/test-punycode.js')
-rw-r--r--test/simple/test-punycode.js13
1 files changed, 13 insertions, 0 deletions
diff --git a/test/simple/test-punycode.js b/test/simple/test-punycode.js
index f3d6dd781..fa6a9c0ec 100644
--- a/test/simple/test-punycode.js
+++ b/test/simple/test-punycode.js
@@ -179,4 +179,17 @@ for (var encoded in tests) {
}
}
+// BMP code point
+assert.equal(punycode.ucs2.encode([0x61]), 'a');
+// supplementary code point (surrogate pair)
+assert.equal(punycode.ucs2.encode([0x1D306]), '\uD834\uDF06');
+// high surrogate
+assert.equal(punycode.ucs2.encode([0xD800]), '\uD800');
+// high surrogate followed by non-surrogates
+assert.equal(punycode.ucs2.encode([0xD800, 0x61, 0x62]), '\uD800ab');
+// low surrogate
+assert.equal(punycode.ucs2.encode([0xDC00]), '\uDC00');
+// low surrogate followed by non-surrogates
+assert.equal(punycode.ucs2.encode([0xDC00, 0x61, 0x62]), '\uDC00ab');
+
assert.equal(errors, 0);