diff --git a/mozilla/js/tests/e4x/XMLList/13.5.4.9.js b/mozilla/js/tests/e4x/XMLList/13.5.4.9.js index 36f0bb3732f..10a460845b1 100644 --- a/mozilla/js/tests/e4x/XMLList/13.5.4.9.js +++ b/mozilla/js/tests/e4x/XMLList/13.5.4.9.js @@ -25,6 +25,7 @@ * Igor Bukanov * Ethan Hugg * Milen Nankov + * Martin Honnen * * Alternatively, the contents of this file may be used under the terms of * either the GNU General Public License Version 2 or later (the "GPL"), or @@ -43,6 +44,39 @@ START("13.5.4.9 - XMLList descendants()"); TEST(1, true, XMLList.prototype.hasOwnProperty("descendants")); - -END(); \ No newline at end of file +// From Martin Honnen + +var gods = + + Kibo + + + Xibo + +; + +var godList = gods.god; + +var expect; +var actual; +var node; +var descendants = godList.descendants(); + +expect = 4; +actual = descendants.length(); +TEST(2, expect, actual) + +expect = 'nodeKind(): element, name(): name;\n' + + 'nodeKind(): text, name(): null;\n' + + 'nodeKind(): element, name(): name;\n' + + 'nodeKind(): text, name(): null;\n'; + +actual = ''; + +for each (var xml in descendants) { + actual += 'nodeKind(): ' + xml.nodeKind() + ', name(): ' + xml.name() + ';\n'; +} +TEST(4, expect, actual); + +END();