Debian Codegraph @

rhino/testsrc/tests/e4x/QName/13.3.2.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.3.2.js';
8
9 START("13.3.2 - QName Constructor");
10
11 q = new QName("*");
12 TEST(1, "object", typeof(q));
13 TEST(2, "*", q.localName);
14 TEST(3, null, q.uri);
15 TEST(4, "*::*", q.toString());
16
17 // Default namespace
18 q = new QName("foobar");
19 TEST(5, "object", typeof(q));
20 TEST(6, "foobar", q.localName);
21 TEST(7, "", q.uri);
22 TEST(8, "foobar", q.toString());
23
24 q = new QName("http://foobar/", "foobar");
25 TEST(9, "object", typeof(q));
26 TEST(10, "foobar", q.localName);
27 TEST(11, "http://foobar/", q.uri);
28 TEST(12, "http://foobar/::foobar", q.toString());
29
30 p = new QName(q);
31 TEST(13, typeof(p), typeof(q));
32 TEST(14, q.localName, p.localName);
33 TEST(15, q.uri, p.uri);
34
35 n = new Namespace("http://foobar/");
36 q = new QName(n, "foobar");
37 TEST(16, "object", typeof(q));
38
39 q = new QName(null);
40 TEST(17, "object", typeof(q));
41 TEST(18, "null", q.localName);
42 TEST(19, "", q.uri);
43 TEST(20, "null", q.toString());
44
45 q = new QName(null, null);
46 TEST(21, "object", typeof(q));
47 TEST(22, "null", q.localName);
48 TEST(23, null, q.uri);
49 TEST(24, "*::null", q.toString());
50
51 END();