test/script/basic/JDK-8171849.js

Wed, 05 Sep 2018 01:21:35 -0700

author
diazhou
date
Wed, 05 Sep 2018 01:21:35 -0700
changeset 2374
037913b52507
parent 1983
6134b9bf1cb6
permissions
-rw-r--r--

Added tag jdk8u192-b09 for changeset 456c0d45c43b

attila@1983 1 /*
attila@1983 2 * Copyright (c) 2016 Oracle and/or its affiliates. All rights reserved.
attila@1983 3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
attila@1983 4 *
attila@1983 5 * This code is free software; you can redistribute it and/or modify it
attila@1983 6 * under the terms of the GNU General Public License version 2 only, as
attila@1983 7 * published by the Free Software Foundation.
attila@1983 8 *
attila@1983 9 * This code is distributed in the hope that it will be useful, but WITHOUT
attila@1983 10 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
attila@1983 11 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
attila@1983 12 * version 2 for more details (a copy is included in the LICENSE file that
attila@1983 13 * accompanied this code).
attila@1983 14 *
attila@1983 15 * You should have received a copy of the GNU General Public License version
attila@1983 16 * 2 along with this work; if not, write to the Free Software Foundation,
attila@1983 17 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
attila@1983 18 *
attila@1983 19 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
attila@1983 20 * or visit www.oracle.com if you need additional information or have any
attila@1983 21 * questions.
attila@1983 22 */
attila@1983 23
attila@1983 24 /**
attila@1983 25 * JDK-8171849: Collection and Queue conversions not prioritized for Arrays
attila@1983 26 *
attila@1983 27 * @test
attila@1983 28 * @run
attila@1983 29 */
attila@1983 30
attila@1983 31 var acp = new (Java.type("jdk.nashorn.test.models.ArrayConversionPreferences"))
attila@1983 32
attila@1983 33 var a = [1, "", {}]
attila@1983 34
attila@1983 35 Assert.assertTrue(acp.testCollectionOverMap(a))
attila@1983 36 Assert.assertTrue(acp.testCollectionOverArray(a))
attila@1983 37 Assert.assertTrue(acp.testListOverMap(a))
attila@1983 38 Assert.assertTrue(acp.testListOverArray(a))
attila@1983 39 Assert.assertTrue(acp.testListOverCollection(a))
attila@1983 40 Assert.assertTrue(acp.testQueueOverMap(a))
attila@1983 41 Assert.assertTrue(acp.testQueueOverArray(a))
attila@1983 42 Assert.assertTrue(acp.testQueueOverCollection(a))
attila@1983 43 Assert.assertTrue(acp.testDequeOverMap(a))
attila@1983 44 Assert.assertTrue(acp.testDequeOverArray(a))
attila@1983 45 Assert.assertTrue(acp.testDequeOverCollection(a))
attila@1983 46 Assert.assertTrue(acp.testDequeOverQueue(a))
attila@1983 47 Assert.assertTrue(acp.testArrayOverMap(a))

mercurial