[Pkg-javascript-commits] [node-entities] 23/63: tests: use single quotes, fixed indentation

Wolfgang Borgert debacle at moszumanska.debian.org
Mon Sep 22 08:15:45 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 b6e8389d2bbb83ba743450672c30d33ee36f0350
Author: Felix Böhm <me at feedic.com>
Date:   Thu Apr 25 15:14:01 2013 +0200

    tests: use single quotes, fixed indentation
---
 test/test.js | 119 ++++++++++++++++++++++++++++++-----------------------------
 1 file changed, 61 insertions(+), 58 deletions(-)

diff --git a/test/test.js b/test/test.js
index c73d0ed..fa6c00d 100644
--- a/test/test.js
+++ b/test/test.js
@@ -1,65 +1,68 @@
-var assert = require('assert');
+var assert = require("assert");
 var entities = require('../');
 
 describe("Encode->decode test", function() {
-    var testcases = [
-        { input: "asdf & ÿ ü '",
-          xml: "asdf & ÿ ü '",
-          html4: "asdf & &yuml &uuml '",
-          html5: "asdf & &yuml &uuml '" },
-        { input: '&',
-          xml: '&#38;',
-          html4: '&#38;',
-          html5: '&#38;' },
-    ];
-    testcases.forEach(function(tc) {
-        var encodedXML = entities.encodeXML(tc.input);
-        it('should XML encode '+tc.input, function() {
-            assert.equal(encodedXML, tc.xml);
-        });
-        it('should XML decode '+encodedXML, function() {
-            assert.equal(entities.decodeXML(encodedXML), tc.input);
-        });
-        var encodedHTML4 = entities.encodeHTML4(tc.input);
-        it('should HTML4 encode '+tc.input, function() {
-            assert.equal(encodedHTML4, tc.html4);
-        });
-        it('should HTML4 decode '+encodedHTML4, function() {
-            assert.equal(entities.decodeHTML4(encodedHTML4), tc.input);
-        });
-        var encodedHTML5 = entities.encodeHTML5(tc.input);
-        it('should HTML5 encode '+tc.input, function() {
-            assert.equal(encodedHTML5, tc.html5);
-        });
-        it('should HTML5 decode '+encodedHTML5, function() {
-            assert.equal(entities.decodeHTML5(encodedHTML5), tc.input);
-        });
-    });
+	var testcases = [
+		{
+			input: "asdf & ÿ ü '",
+			xml: "asdf & ÿ ü '",
+			html4: "asdf & ÿ ü '",
+			html5: "asdf & ÿ ü '"
+		}, {
+			input: "&",
+			xml: "&#38;",
+			html4: "&#38;",
+			html5: "&#38;"
+		},
+	];
+	testcases.forEach(function(tc) {
+		var encodedXML = entities.encodeXML(tc.input);
+		it("should XML encode " + tc.input, function() {
+			assert.equal(encodedXML, tc.xml);
+		});
+		it("should XML decode " + encodedXML, function() {
+			assert.equal(entities.decodeXML(encodedXML), tc.input);
+		});
+		var encodedHTML4 = entities.encodeHTML4(tc.input);
+		it("should HTML4 encode " + tc.input, function() {
+			assert.equal(encodedHTML4, tc.html4);
+		});
+		it("should HTML4 decode " + encodedHTML4, function() {
+			assert.equal(entities.decodeHTML4(encodedHTML4), tc.input);
+		});
+		var encodedHTML5 = entities.encodeHTML5(tc.input);
+		it("should HTML5 encode " + tc.input, function() {
+			assert.equal(encodedHTML5, tc.html5);
+		});
+		it("should HTML5 decode " + encodedHTML5, function() {
+			assert.equal(entities.decodeHTML5(encodedHTML5), tc.input);
+		});
+	});
 });
 
 describe("Decode test", function() {
-    var testcases = [
-	{ input: '&amp;',  output: '&' },
-	{ input: '&#38;',  output: '&' },
-	{ input: '&#x26;', output: '&#x26;' },
-	{ input: '&#X26;', output: '&#X26;' },
-	{ input: '&#38;',  output: '&' },
-	{ input: '&#x26;#38;', output: '&' },
-	{ input: '&#X26;#38;', output: '&' },
-	{ input: '&#x3a;',     output: ':' },
-	{ input: '&#x3A;',     output: ':' },
-	{ input: '&#X3a;',     output: ':' },
-	{ input: '&#X3A;',     output: ':' }
-    ];
-    testcases.forEach(function(tc) {
-        it('should XML decode '+tc.input, function() {
-            assert.equal(entities.decodeXML(tc.input), tc.output);
-        });
-        it('should HTML4 decode '+tc.input, function() {
-            assert.equal(entities.decodeHTML4(tc.input), tc.output);
-        });
-        it('should HTML5 decode '+tc.input, function() {
-            assert.equal(entities.decodeHTML5(tc.input), tc.output);
-        });
-    });
+	var testcases = [
+		{ input: "&amp;",  output: "&" },
+		{ input: "&#38;",  output: "&" },
+		{ input: "&#x26;", output: "&#x26;" },
+		{ input: "&#X26;", output: "&#X26;" },
+		{ input: "&#38;",  output: "&" },
+		{ input: "&#x26;#38;", output: "&" },
+		{ input: "&#X26;#38;", output: "&" },
+		{ input: "&#x3a;",     output: ":" },
+		{ input: "&#x3A;",     output: ":" },
+		{ input: "&#X3a;",     output: ":" },
+		{ input: "&#X3A;",     output: ":" }
+	];
+	testcases.forEach(function(tc) {
+		it("should XML decode " + tc.input, function() {
+			assert.equal(entities.decodeXML(tc.input), tc.output);
+		});
+		it("should HTML4 decode " + tc.input, function() {
+			assert.equal(entities.decodeHTML4(tc.input), tc.output);
+		});
+		it("should HTML5 decode " + tc.input, function() {
+			assert.equal(entities.decodeHTML5(tc.input), tc.output);
+		});
+	});
 });

-- 
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