[Pkg-javascript-commits] [node-entities] 50/63: added/enabled tests for astral entities
Wolfgang Borgert
debacle at moszumanska.debian.org
Mon Sep 22 08:15:48 UTC 2014
This is an automated email from the git hooks/post-receive script.
debacle pushed a commit to branch master
in repository node-entities.
commit abcdfbf233679ca3e1576119c0d96966515b6522
Author: fb55 <me at feedic.com>
Date: Mon Mar 17 21:15:13 2014 +0100
added/enabled tests for astral entities
---
test/test.js | 21 +++++++++++++++++----
1 file changed, 17 insertions(+), 4 deletions(-)
diff --git a/test/test.js b/test/test.js
index bac7cd9..7bddf66 100644
--- a/test/test.js
+++ b/test/test.js
@@ -73,7 +73,7 @@ var levels = ["xml", "entities"];
describe("Documents", function(){
levels
- .map(function(n){ return path.join("..", "entities", n); })
+ .map(function(n){ return path.join("..", "maps", n); })
.map(require)
.forEach(function(doc, i){
describe("Decode", function(){
@@ -107,7 +107,7 @@ describe("Documents", function(){
});
});
- var legacy = require("../entities/legacy.json");
+ var legacy = require("../maps/legacy.json");
describe("Legacy", function(){
it("should decode", runLegacy);
@@ -125,13 +125,26 @@ var astral = {
"1D11E": "\uD834\uDD1E"
};
+var astralSpecial = {
+ "80": "\u20AC",
+ "110000": "\uFFFD"
+};
+
+
describe("Astral entities", function(){
Object.keys(astral).forEach(function(c){
- /*it("should decode " + astral[c], function(){
+ it("should decode " + astral[c], function(){
assert.equal(entities.decode("&#x" + c + ";"), astral[c]);
- });*/
+ });
+
it("should encode " + astral[c], function(){
assert.equal(entities.encode(astral[c]), "&#x" + c + ";");
});
});
+
+ Object.keys(astralSpecial).forEach(function(c){
+ it("special should decode \\u" + c, function(){
+ assert.equal(entities.decode("&#x" + c + ";"), astralSpecial[c]);
+ });
+ });
});
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-javascript/node-entities.git
More information about the Pkg-javascript-commits
mailing list