Debian Codegraph @

rhino/testsrc/tests/e4x/XMLList/13.5.4.3.js

raw symbols SCIP
1 /* -*- Mode: java; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*-
2 *
3 * This Source Code Form is subject to the terms of the Mozilla Public
4 * License, v. 2.0. If a copy of the MPL was not distributed with this
5 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
6
7 gTestfile = '13.5.4.3.js';
8
9 START("13.5.4.3 - XMLList attributes()");
10
11 TEST(1, true, XMLList.prototype.hasOwnProperty("attributes"));
12
13 // Test with XMLList of size 0
14 x = new XMLList()
15 TEST(2, "xml", typeof(x.attributes()));
16 TEST_XML(3, "", x.attributes());
17
18 // Test with XMLList of size 1
19 x += <alpha attr1="value1" attr2="value2">one</alpha>;
20
21 TEST(4, "xml", typeof(x.attributes()));
22 correct = new XMLList();
23 correct += new XML("value1");
24 correct += new XML("value2");
25 TEST(5, correct, x.attributes());
26
27 // Test with XMLList of size > 1
28 x += <bravo attr3="value3" attr4="value4">two</bravo>;
29
30 TEST(6, "xml", typeof(x.attributes()));
31 correct = new XMLList();
32 correct += new XML("value1");
33 correct += new XML("value2");
34 correct += new XML("value3");
35 correct += new XML("value4");
36 TEST(7, correct, x.attributes());
37
38 END();