rhino1.7.7.testsrc.tests.e4x.XMLList.13.5.2.js Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of rhino Show documentation
Show all versions of rhino Show documentation
Rhino is an open-source implementation of JavaScript written entirely in Java. It is typically
embedded into Java applications to provide scripting to end users.
/* -*- Mode: java; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*-
*
* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
gTestfile = '13.5.2.js';
START("13.5.2 - XMLList Constructor");
x = new XMLList();
TEST(1, "xml", typeof(x));
TEST(2, true, x instanceof XMLList);
// Load from another XMLList
// Make sure it is copied if it's an XMLList
x =
<>
one
two
>;
y = new XMLList(x);
x += three ;
TEST(3, "one \ntwo ", y.toString());
// Load from one XML type
x = new XMLList(one );
TEST_XML(4, "one ", x);
// Load from Anonymous
x = new XMLList(<>one two >);
TEST(5, "one \ntwo ", x.toString());
// Load from Anonymous as string
x = new XMLList(<>one two >);
TEST(6, "one \ntwo ", x.toString());
// Load from single textnode
x = new XMLList("foobar");
TEST_XML(7, "foobar", x);
x = XMLList(7);
TEST_XML(8, 7, x);
// Undefined and null should behave like ""
x = new XMLList(null);
TEST_XML(9, "", x);
x = new XMLList(undefined);
TEST_XML(10, "", x);
END();
© 2015 - 2024 Weber Informatics LLC | Privacy Policy