JDK-8015353.js revision 877:cf4d2252d444
1139776Simp/*
222521Sdyson * Copyright (c) 2010, 2013, Oracle and/or its affiliates. All rights reserved.
322521Sdyson * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4234867Sdaichi *
5234867Sdaichi * This code is free software; you can redistribute it and/or modify it
61541Srgrimes * under the terms of the GNU General Public License version 2 only, as
71541Srgrimes * published by the Free Software Foundation.
81541Srgrimes *
91541Srgrimes * This code is distributed in the hope that it will be useful, but WITHOUT
101541Srgrimes * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
111541Srgrimes * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
121541Srgrimes * version 2 for more details (a copy is included in the LICENSE file that
131541Srgrimes * accompanied this code).
141541Srgrimes *
151541Srgrimes * You should have received a copy of the GNU General Public License version
161541Srgrimes * 2 along with this work; if not, write to the Free Software Foundation,
171541Srgrimes * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
181541Srgrimes *
191541Srgrimes * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
201541Srgrimes * or visit www.oracle.com if you need additional information or have any
211541Srgrimes * questions.
221541Srgrimes */
231541Srgrimes
241541Srgrimes/**
251541Srgrimes * JDK-8015353: Date.parse illegal string parsing issues
261541Srgrimes *
271541Srgrimes * @test
281541Srgrimes * @run
291541Srgrimes */
301541Srgrimes
311541Srgrimesfunction checkDate(str) {
321541Srgrimes    if (! isNaN(Date.parse(str))) {
331541Srgrimes        fail(str + " is parsed as legal Date");
341541Srgrimes    }
3522521Sdyson}
3650477Speter
371541SrgrimescheckDate("2012-01-10T00:00:00.000-");
381541SrgrimescheckDate("2012-01-01T00:00+");
391541Srgrimes