hannesw@1962: /* hannesw@1962: * Copyright (c) 2016, Oracle and/or its affiliates. All rights reserved. hannesw@1962: * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. hannesw@1962: * hannesw@1962: * This code is free software; you can redistribute it and/or modify it hannesw@1962: * under the terms of the GNU General Public License version 2 only, as hannesw@1962: * published by the Free Software Foundation. hannesw@1962: * hannesw@1962: * This code is distributed in the hope that it will be useful, but WITHOUT hannesw@1962: * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or hannesw@1962: * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License hannesw@1962: * version 2 for more details (a copy is included in the LICENSE file that hannesw@1962: * accompanied this code). hannesw@1962: * hannesw@1962: * You should have received a copy of the GNU General Public License version hannesw@1962: * 2 along with this work; if not, write to the Free Software Foundation, hannesw@1962: * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. hannesw@1962: * hannesw@1962: * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA hannesw@1962: * or visit www.oracle.com if you need additional information or have any hannesw@1962: * questions. hannesw@1962: */ hannesw@1962: hannesw@1962: /** hannesw@1962: * JDK-8163945: Honor Number type hint in toPrimitive on Numbers hannesw@1962: * hannesw@1962: * @test hannesw@1962: * @run hannesw@1962: */ hannesw@1962: hannesw@1962: function assertLessThan(a, b) { hannesw@1962: Assert.assertTrue(a < b); hannesw@1962: Assert.assertTrue(a <= b); hannesw@1962: Assert.assertFalse(a >= b); hannesw@1962: Assert.assertFalse(a > b); hannesw@1962: } hannesw@1962: hannesw@1962: assertLessThan(new java.lang.Long(2), new java.lang.Long(10)); hannesw@1962: assertLessThan(new java.lang.Long(2), 10); hannesw@1962: assertLessThan(2, new java.lang.Long(10)); hannesw@1962: hannesw@1962: assertLessThan(new java.math.BigInteger(2), new java.math.BigInteger(10)); hannesw@1962: assertLessThan(new java.math.BigInteger(2), 10); hannesw@1962: assertLessThan(2, new java.math.BigInteger(10)); hannesw@1962: hannesw@1962: assertLessThan(new java.util.concurrent.atomic.AtomicInteger(2), new java.util.concurrent.atomic.AtomicInteger(10)); hannesw@1962: assertLessThan(new java.util.concurrent.atomic.AtomicInteger(2), 10); hannesw@1962: assertLessThan(2, new java.util.concurrent.atomic.AtomicInteger(10));