[Pkg-javascript-commits] [node-expat] 45/371: test.js: test for new cdata events

Jonas Smedegaard dr at jones.dk
Sun Feb 28 09:59:43 UTC 2016


This is an automated email from the git hooks/post-receive script.

js pushed a commit to branch master
in repository node-expat.

commit 97e60e1581f09741e08eac939c4012b78201ce05
Author: Astro <astro at spaceboyz.net>
Date:   Thu Dec 2 18:44:03 2010 +0100

    test.js: test for new cdata events
---
 test.js | 14 ++++++++++++++
 1 file changed, 14 insertions(+)

diff --git a/test.js b/test.js
index 24e2c6b..4367f7e 100644
--- a/test.js
+++ b/test.js
@@ -46,6 +46,12 @@ function expect(s, evs_expected) {
 	p.addListener('xmlDecl', function(version, encoding, standalone) {
 	    evs_received.push(['xmlDecl', version, encoding, standalone]);
 	});
+	p.addListener('startCdata', function() {
+	    evs_received.push(['startCdata']);
+	});
+	p.addListener('endCdata', function() {
+	    evs_received.push(['endCdata']);
+	});
 	for(var l = 0; l < s.length; l += step)
 	{
 	    var end = l + step;
@@ -90,7 +96,9 @@ expect("<r>foo\nbar</r>",
 	['endElement', 'r']]);
 expect("<r><![CDATA[<greeting>Hello, world!</greeting>]]></r>",
        [['startElement', 'r', {}],
+	['startCdata'],
 	['text', "<greeting>Hello, world!</greeting>"],
+	['endCdata'],
 	['endElement', 'r']]);
 expect("<r>foo&bar</r>",
        [['startElement', 'r', {}],
@@ -115,5 +123,11 @@ expect(new Buffer('<foo>bar</foo>'),
        [['startElement', 'foo', {}],
 	['text', 'bar'],
 	['endElement', 'foo']]);
+expect(new Buffer('<foo><![CDATA[bar]]></foo>'),
+       [['startElement', 'foo', {}],
+	['startCdata'],
+	['text', 'bar'],
+	['endCdata'],
+	['endElement', 'foo']]);
 
 sys.puts("Ran "+tests+" tests with "+iterations+" iterations: "+fails+" failures.");

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-javascript/node-expat.git



More information about the Pkg-javascript-commits mailing list