From ac00f32e0d9d6bad8ebd6b36f75b00b2f3a5f78d Mon Sep 17 00:00:00 2001 From: Tom MacWright Date: Tue, 30 Aug 2011 16:01:10 -0400 Subject: [PATCH] Cheap addition of node order. Fixes #94 --- test/support/helper.js | 2 ++ 1 file changed, 2 insertions(+) diff --git a/test/support/helper.js b/test/support/helper.js index 69548b1..c2aa12f 100644 --- a/test/support/helper.js +++ b/test/support/helper.js @@ -82,10 +82,12 @@ exports.compareToFile = function(value, originalFile, resultFile) { exports.parseXML = function(xml, callback) { var parser = sax.parser(true); + var i = 0; var tree = [ {} ]; parser.onopentag = function(node) { if (!(node.name in tree[0])) tree[0][node.name] = []; + node.attributes.__order__ = i++; tree[0][node.name].push(node.attributes); tree.unshift(node.attributes); };