Debian Codegraph @

rhino/testsrc/tests/e4x/XMLList/13.5.4.13.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.13.js';
8
9 START("13.5.4.13 - XMLList hasSimpleContent()");
10
11 TEST(1, true, XMLList.prototype.hasOwnProperty("hasSimpleContent"));
12
13 // One element should be same as XML case
14 x =
15 <>
16 <alpha attr1="value1">
17 <bravo>one</bravo>
18 <charlie>
19 two
20 three
21 <echo>four</echo>
22 </charlie>
23 <delta />
24 <foxtrot attr2="value2">five</foxtrot>
25 <golf attr3="value3" />
26 <hotel>
27 six
28 seven
29 </hotel>
30 <india><juliet /></india>
31 </alpha>;
32 </>;
33
34 TEST(2, false, x.hasSimpleContent());
35 TEST(3, true, x.bravo.hasSimpleContent());
36 TEST(4, false, x.charlie.hasSimpleContent());
37 TEST(5, true, x.delta.hasSimpleContent());
38 TEST(6, true, x.foxtrot.hasSimpleContent());
39 TEST(7, true, x.golf.hasSimpleContent());
40 TEST(8, true, x.hotel.hasSimpleContent());
41 TEST(9, true, x.@attr1.hasSimpleContent());
42 TEST(10, true, x.bravo.child(0).hasSimpleContent());
43 TEST(11, false, x.india.hasSimpleContent());
44
45 // More than one element is complex if one or more things in the list are elements.
46 x =
47 <>
48 <alpha>one</alpha>
49 <bravo>two</bravo>
50 </>;
51
52 TEST(12, false, x.hasSimpleContent());
53
54 x =
55 <root>
56 one
57 <alpha>one</alpha>
58 </root>;
59
60 TEST(13, false, x.*.hasSimpleContent());
61
62 x =
63 <root attr1="value1" attr2="value2">
64 one
65 </root>;
66
67 TEST(14, true, x.@*.hasSimpleContent());
68
69 END();