From 0ce398d4e943ea422cd4bdd2132c537daa8890cc Mon Sep 17 00:00:00 2001 From: "bob%bclary.com" Date: Mon, 18 Apr 2005 20:02:20 +0000 Subject: [PATCH] Additional tests by Martin Honnen, Bug 290481 git-svn-id: svn://10.0.0.236/trunk@172400 18797224-902f-48f8-a5cc-f745e15eee43 --- mozilla/js/tests/e4x/XMLList/13.5.4.9.js | 38 ++++++++++++++++++++++-- 1 file changed, 36 insertions(+), 2 deletions(-) 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();