[Pkg-javascript-commits] [ltx] 226/469: fix sax parsing test

Jonas Smedegaard dr at jones.dk
Wed Aug 31 13:03:06 UTC 2016


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

js pushed a commit to branch master
in repository ltx.

commit 5325ad69bded422fd76c25218d4720e32e493750
Author: Astro <astro at spaceboyz.net>
Date:   Tue Mar 20 04:02:24 2012 +0100

    fix sax parsing test
---
 test/parse-test.js | 13 ++++++++++---
 1 file changed, 10 insertions(+), 3 deletions(-)

diff --git a/test/parse-test.js b/test/parse-test.js
index aaae2af..f4c7615 100644
--- a/test/parse-test.js
+++ b/test/parse-test.js
@@ -66,7 +66,7 @@ ltx.availableSaxParsers.forEach(function(saxParser) {
         },
 	'SAX parsing': {
 	    'XMPP stream': function() {
-		var parser = new ltx.Parser(saxParser);
+		var parser = new saxParser();
 		var events = [];
 		parser.on('startElement', function(name) {
 		    events.push({ start: name });
@@ -79,14 +79,21 @@ ltx.availableSaxParsers.forEach(function(saxParser) {
 		});
 		parser.write("<?xml version='1.0'?><stream:stream xmlns='jabber:client'");
 		parser.write(" xmlns:stream='http://etherx.jabber.org/streams' id='5568");
+		assert.equal(events.length, 0);
 		parser.write("90365' from='jabber.ccc.de' version='1.0' xml:lang='en'><");
+		assert.equal(events.length, 1);
 		parser.write("stream:features><starttls xmlns='urn:ietf:params:xml:ns:x");
+		assert.equal(events.length, 2);
 		parser.write("mpp-tls'/><mechanisms xmlns='urn:ietf:params:xml:ns:xmpp-");
+		assert.equal(events.length, 4);
 		parser.write("sasl'><mechanism>PLAIN</mechanism><mechanism>DIGEST-MD5</");
+		assert.equal(events.length, 9);
 		parser.write("mechanism><mechanism>SCRAM-SHA-1</mechanism></mechanisms>");
+		assert.equal(events.length, 15);
 		parser.write("<register xmlns='http://jabber.org/features/iq-register'/");
-		parser.write("></stream:features>'");
-		console.log(events);
+		assert.equal(events.length, 15);
+		parser.write("></stream:features>");
+		assert.equal(events.length, 18);
 	    }
 	}
     }).export(module);

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



More information about the Pkg-javascript-commits mailing list