Home | History | Annotate | Download | only in webkit
      1 # Copyright 2013 the V8 project authors. All rights reserved.
      2 # Copyright (C) 2005, 2006, 2007, 2008, 2009 Apple Inc. All rights reserved.
      3 #
      4 # Redistribution and use in source and binary forms, with or without
      5 # modification, are permitted provided that the following conditions
      6 # are met:
      7 # 1.  Redistributions of source code must retain the above copyright
      8 #     notice, this list of conditions and the following disclaimer.
      9 # 2.  Redistributions in binary form must reproduce the above copyright
     10 #     notice, this list of conditions and the following disclaimer in the
     11 #     documentation and/or other materials provided with the distribution.
     12 #
     13 # THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS'' AND ANY
     14 # EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
     15 # WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
     16 # DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS BE LIABLE FOR ANY
     17 # DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
     18 # (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
     19 # LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
     20 # ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
     21 # (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
     22 # SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
     23 
     24 test of JavaScript date parsing (comments in parentheses)
     25 
     26 On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
     27 
     28 
     29 PASS Date.parse("Dec ((27) 26 (24)) 25 1995 1:30 PM UTC") == 819898200000 is true
     30 PASS Date.parse("DEC ((27) 26 (24)) 25 1995 1:30 PM UTC") == 819898200000 is true
     31 PASS Date.parse("dec ((27) 26 (24)) 25 1995 1:30 pm utc") == 819898200000 is true
     32 PASS Date.parse("Dec 25 1995 1:30 PM UTC (") == 819898200000 is true
     33 PASS Date.parse("DEC 25 1995 1:30 PM UTC (") == 819898200000 is true
     34 PASS Date.parse("dec 25 1995 1:30 pm utc (") == 819898200000 is true
     35 PASS Date.parse("Dec 25 1995 1:30 (PM)) UTC") is NaN
     36 PASS Date.parse("DEC 25 1995 1:30 (PM)) UTC") is NaN
     37 PASS Date.parse("dec 25 1995 1:30 (pm)) utc") is NaN
     38 PASS Date.parse("(Nov) Dec (24) 25 (26) 1995 (1996) GMT (EST)") == 819849600000 is true
     39 PASS Date.parse("(NOV) DEC (24) 25 (26) 1995 (1996) GMT (EST)") == 819849600000 is true
     40 PASS Date.parse("(nov) dec (24) 25 (26) 1995 (1996) gmt (est)") == 819849600000 is true
     41 PASS Date.parse("(Nov) Dec (24) 25 (26) 1995 (1996)") == 819849600000 + timeZoneOffset is true
     42 PASS Date.parse("(NOV) DEC (24) 25 (26) 1995 (1996)") == 819849600000 + timeZoneOffset is true
     43 PASS Date.parse("(nov) dec (24) 25 (26) 1995 (1996)") == 819849600000 + timeZoneOffset is true
     44 PASS Date.parse("(Nov) Dec (24) 25 (26) 1995 (1996) 1:30 (1:40) GMT (EST)") == 819855000000 is true
     45 PASS Date.parse("(NOV) DEC (24) 25 (26) 1995 (1996) 1:30 (1:40) GMT (EST)") == 819855000000 is true
     46 PASS Date.parse("(nov) dec (24) 25 (26) 1995 (1996) 1:30 (1:40) gmt (est)") == 819855000000 is true
     47 PASS Date.parse("(Nov) Dec (24) 25 (26) 1995 (1996) 1:30 (1:40)") == 819855000000 + timeZoneOffset is true
     48 PASS Date.parse("(NOV) DEC (24) 25 (26) 1995 (1996) 1:30 (1:40)") == 819855000000 + timeZoneOffset is true
     49 PASS Date.parse("(nov) dec (24) 25 (26) 1995 (1996) 1:30 (1:40)") == 819855000000 + timeZoneOffset is true
     50 PASS Date.parse("(Nov) Dec (24) 25 (26) 1995 (1996) 1:30 ") == 819855000000 + timeZoneOffset is true
     51 PASS Date.parse("(NOV) DEC (24) 25 (26) 1995 (1996) 1:30 ") == 819855000000 + timeZoneOffset is true
     52 PASS Date.parse("(nov) dec (24) 25 (26) 1995 (1996) 1:30 ") == 819855000000 + timeZoneOffset is true
     53 PASS Date.parse("(Nov) Dec (24) 25 (26) 1995 (1996) 1:30 AM (1:40 PM) GMT (EST)") == 819855000000 is true
     54 PASS Date.parse("(NOV) DEC (24) 25 (26) 1995 (1996) 1:30 AM (1:40 PM) GMT (EST)") == 819855000000 is true
     55 PASS Date.parse("(nov) dec (24) 25 (26) 1995 (1996) 1:30 am (1:40 pm) gmt (est)") == 819855000000 is true
     56 PASS Date.parse("(Nov) Dec (24) 25 (26) 1995 (1996) 1:30 AM (1:40 PM)") == 819855000000 + timeZoneOffset is true
     57 PASS Date.parse("(NOV) DEC (24) 25 (26) 1995 (1996) 1:30 AM (1:40 PM)") == 819855000000 + timeZoneOffset is true
     58 PASS Date.parse("(nov) dec (24) 25 (26) 1995 (1996) 1:30 am (1:40 pm)") == 819855000000 + timeZoneOffset is true
     59 PASS Date.parse("Dec 25 1995 1:30( )AM (PM)") is NaN
     60 PASS Date.parse("DEC 25 1995 1:30( )AM (PM)") is NaN
     61 PASS Date.parse("dec 25 1995 1:30( )am (pm)") is NaN
     62 PASS Date.parse("Dec 25 1995 1:30 AM (PM)") == 819855000000 + timeZoneOffset is true
     63 PASS Date.parse("DEC 25 1995 1:30 AM (PM)") == 819855000000 + timeZoneOffset is true
     64 PASS Date.parse("dec 25 1995 1:30 am (pm)") == 819855000000 + timeZoneOffset is true
     65 PASS Date.parse("(Nov) Dec (24) 25 (26) 1995 (1996) 13:30 (13:40) GMT (PST)") == 819898200000 is true
     66 PASS Date.parse("(NOV) DEC (24) 25 (26) 1995 (1996) 13:30 (13:40) GMT (PST)") == 819898200000 is true
     67 PASS Date.parse("(nov) dec (24) 25 (26) 1995 (1996) 13:30 (13:40) gmt (pst)") == 819898200000 is true
     68 PASS Date.parse("(Nov) Dec (24) 25 (26) 1995 (1996) 13:30 (13:40)") == 819898200000 + timeZoneOffset is true
     69 PASS Date.parse("(NOV) DEC (24) 25 (26) 1995 (1996) 13:30 (13:40)") == 819898200000 + timeZoneOffset is true
     70 PASS Date.parse("(nov) dec (24) 25 (26) 1995 (1996) 13:30 (13:40)") == 819898200000 + timeZoneOffset is true
     71 PASS Date.parse("(Nov) Dec (24) 25 (26) 13:30 (13:40) 1995 (1996)") == 819898200000 + timeZoneOffset is true
     72 PASS Date.parse("(NOV) DEC (24) 25 (26) 13:30 (13:40) 1995 (1996)") == 819898200000 + timeZoneOffset is true
     73 PASS Date.parse("(nov) dec (24) 25 (26) 13:30 (13:40) 1995 (1996)") == 819898200000 + timeZoneOffset is true
     74 PASS Date.parse("(Nov) Dec (24) 25 (26) 1995 (1996) 13:30 (13:40) ") == 819898200000 + timeZoneOffset is true
     75 PASS Date.parse("(NOV) DEC (24) 25 (26) 1995 (1996) 13:30 (13:40) ") == 819898200000 + timeZoneOffset is true
     76 PASS Date.parse("(nov) dec (24) 25 (26) 1995 (1996) 13:30 (13:40) ") == 819898200000 + timeZoneOffset is true
     77 PASS Date.parse("(Nov) Dec (24) 25 (26) 1995 (1996) 1:30 (1:40) PM (AM) GMT (PST)") == 819898200000 is true
     78 PASS Date.parse("(NOV) DEC (24) 25 (26) 1995 (1996) 1:30 (1:40) PM (AM) GMT (PST)") == 819898200000 is true
     79 PASS Date.parse("(nov) dec (24) 25 (26) 1995 (1996) 1:30 (1:40) pm (am) gmt (pst)") == 819898200000 is true
     80 PASS Date.parse("(Nov) Dec (24) 25 (26) 1995 (1996) 1:30 (1:40) PM (AM)") == 819898200000 + timeZoneOffset is true
     81 PASS Date.parse("(NOV) DEC (24) 25 (26) 1995 (1996) 1:30 (1:40) PM (AM)") == 819898200000 + timeZoneOffset is true
     82 PASS Date.parse("(nov) dec (24) 25 (26) 1995 (1996) 1:30 (1:40) pm (am)") == 819898200000 + timeZoneOffset is true
     83 PASS Date.parse("Dec 25 1995 1:30(AM)PM") is NaN
     84 PASS Date.parse("DEC 25 1995 1:30(AM)PM") is NaN
     85 PASS Date.parse("dec 25 1995 1:30(am)pm") is NaN
     86 PASS Date.parse("Dec 25 1995 1:30 (AM)PM ") == 819898200000 + timeZoneOffset is true
     87 PASS Date.parse("DEC 25 1995 1:30 (AM)PM ") == 819898200000 + timeZoneOffset is true
     88 PASS Date.parse("dec 25 1995 1:30 (am)pm ") == 819898200000 + timeZoneOffset is true
     89 PASS Date.parse("Dec 25 1995 (PDT)UTC(PST)") == 819849600000 is true
     90 PASS Date.parse("DEC 25 1995 (PDT)UTC(PST)") == 819849600000 is true
     91 PASS Date.parse("dec 25 1995 (pdt)utc(pst)") == 819849600000 is true
     92 PASS Date.parse("Dec 25 1995 (PDT)UT(PST)") == 819849600000 is true
     93 PASS Date.parse("DEC 25 1995 (PDT)UT(PST)") == 819849600000 is true
     94 PASS Date.parse("dec 25 1995 (pdt)ut(pst)") == 819849600000 is true
     95 PASS Date.parse("Dec 25 1995 (UTC)PST(GMT)") == 819878400000 is true
     96 PASS Date.parse("DEC 25 1995 (UTC)PST(GMT)") == 819878400000 is true
     97 PASS Date.parse("dec 25 1995 (utc)pst(gmt)") == 819878400000 is true
     98 PASS Date.parse("Dec 25 1995 (UTC)PDT(GMT)") == 819874800000 is true
     99 PASS Date.parse("DEC 25 1995 (UTC)PDT(GMT)") == 819874800000 is true
    100 PASS Date.parse("dec 25 1995 (utc)pdt(gmt)") == 819874800000 is true
    101 PASS Date.parse("Dec 25 1995 1:30 (PDT)UTC(PST)") == 819855000000 is true
    102 PASS Date.parse("DEC 25 1995 1:30 (PDT)UTC(PST)") == 819855000000 is true
    103 PASS Date.parse("dec 25 1995 1:30 (pdt)utc(pst)") == 819855000000 is true
    104 PASS Date.parse("Dec 25 1995 1:30 (PDT)UT(PST)") == 819855000000 is true
    105 PASS Date.parse("DEC 25 1995 1:30 (PDT)UT(PST)") == 819855000000 is true
    106 PASS Date.parse("dec 25 1995 1:30 (pdt)ut(pst)") == 819855000000 is true
    107 PASS Date.parse("Dec 25 1995 1:30 (UTC)PST(GMT)") == 819883800000 is true
    108 PASS Date.parse("DEC 25 1995 1:30 (UTC)PST(GMT)") == 819883800000 is true
    109 PASS Date.parse("dec 25 1995 1:30 (utc)pst(gmt)") == 819883800000 is true
    110 PASS Date.parse("Dec 25 1995 1:30 (UTC)PDT(GMT)") == 819880200000 is true
    111 PASS Date.parse("DEC 25 1995 1:30 (UTC)PDT(GMT)") == 819880200000 is true
    112 PASS Date.parse("dec 25 1995 1:30 (utc)pdt(gmt)") == 819880200000 is true
    113 PASS Date.parse("Dec 25 1995 1:30 (AM) PM (PST) UTC") == 819898200000 is true
    114 PASS Date.parse("DEC 25 1995 1:30 (AM) PM (PST) UTC") == 819898200000 is true
    115 PASS Date.parse("dec 25 1995 1:30 (am) pm (pst) utc") == 819898200000 is true
    116 PASS Date.parse("Dec 25 1995 1:30 PM (AM) (PST) UT") == 819898200000 is true
    117 PASS Date.parse("DEC 25 1995 1:30 PM (AM) (PST) UT") == 819898200000 is true
    118 PASS Date.parse("dec 25 1995 1:30 pm (am) (pst) ut") == 819898200000 is true
    119 PASS Date.parse("Dec 25 1995 1:30 PM (AM) (UTC) PST") == 819927000000 is true
    120 PASS Date.parse("DEC 25 1995 1:30 PM (AM) (UTC) PST") == 819927000000 is true
    121 PASS Date.parse("dec 25 1995 1:30 pm (am) (utc) pst") == 819927000000 is true
    122 PASS Date.parse("Dec 25 1995 1:30 (AM) PM PDT (UTC)") == 819923400000 is true
    123 PASS Date.parse("DEC 25 1995 1:30 (AM) PM PDT (UTC)") == 819923400000 is true
    124 PASS Date.parse("dec 25 1995 1:30 (am) pm pdt (utc)") == 819923400000 is true
    125 PASS Date.parse("Dec 25 1995 XXX (GMT)") is NaN
    126 PASS Date.parse("DEC 25 1995 XXX (GMT)") is NaN
    127 PASS Date.parse("dec 25 1995 xxx (gmt)") is NaN
    128 PASS Date.parse("Dec 25 1995 1:30 XXX (GMT)") is NaN
    129 PASS Date.parse("DEC 25 1995 1:30 XXX (GMT)") is NaN
    130 PASS Date.parse("dec 25 1995 1:30 xxx (gmt)") is NaN
    131 PASS Date.parse("Dec 25 1995 1:30 U(TC)") is NaN
    132 PASS Date.parse("DEC 25 1995 1:30 U(TC)") is NaN
    133 PASS Date.parse("dec 25 1995 1:30 u(tc)") is NaN
    134 PASS Date.parse("Dec 25 1995 1:30 V(UTC)") is NaN
    135 PASS Date.parse("DEC 25 1995 1:30 V(UTC)") is NaN
    136 PASS Date.parse("dec 25 1995 1:30 v(utc)") is NaN
    137 PASS Date.parse("Dec 25 1995 1:30 (UTC)W") is NaN
    138 PASS Date.parse("DEC 25 1995 1:30 (UTC)W") is NaN
    139 PASS Date.parse("dec 25 1995 1:30 (utc)w") is NaN
    140 PASS Date.parse("Dec 25 1995 1:30 (GMT)X") is NaN
    141 PASS Date.parse("DEC 25 1995 1:30 (GMT)X") is NaN
    142 PASS Date.parse("dec 25 1995 1:30 (gmt)x") is NaN
    143 PASS Date.parse("Dec 25 1995 0:30 (PM) GMT") == 819851400000 is true
    144 PASS Date.parse("DEC 25 1995 0:30 (PM) GMT") == 819851400000 is true
    145 PASS Date.parse("dec 25 1995 0:30 (pm) gmt") == 819851400000 is true
    146 PASS Date.parse("Dec 25 1995 (1)0:30 AM GMT") == 819851400000 is true
    147 PASS Date.parse("DEC 25 1995 (1)0:30 AM GMT") == 819851400000 is true
    148 PASS Date.parse("dec 25 1995 (1)0:30 am gmt") == 819851400000 is true
    149 PASS Date.parse("Dec 25 1995 (1)0:30 PM GMT") == 819894600000 is true
    150 PASS Date.parse("DEC 25 1995 (1)0:30 PM GMT") == 819894600000 is true
    151 PASS Date.parse("dec 25 1995 (1)0:30 pm gmt") == 819894600000 is true
    152 PASS Date.parse("Anf(Dec) 25 1995 GMT") is NaN
    153 PASS Date.parse("ANF(DEC) 25 1995 GMT") is NaN
    154 PASS Date.parse("anf(dec) 25 1995 gmt") is NaN
    155 PASS Date.parse("(Sat) Wed (Nov) Dec (Nov) 25 1995 1:30 GMT") == 819855000000 is true
    156 PASS Date.parse("(SAT) WED (NOV) DEC (NOV) 25 1995 1:30 GMT") == 819855000000 is true
    157 PASS Date.parse("(sat) wed (nov) dec (nov) 25 1995 1:30 gmt") == 819855000000 is true
    158 PASS Date.parse("Wed (comment 1) (comment 2) Dec 25 1995 1:30 GMT") == 819855000000 is true
    159 PASS Date.parse("WED (COMMENT 1) (COMMENT 2) DEC 25 1995 1:30 GMT") == 819855000000 is true
    160 PASS Date.parse("wed (comment 1) (comment 2) dec 25 1995 1:30 gmt") == 819855000000 is true
    161 PASS Date.parse("Wed(comment 1) (comment 2) Dec 25 1995 1:30 GMT") == 819855000000 is true
    162 PASS Date.parse("WED(COMMENT 1) (COMMENT 2) DEC 25 1995 1:30 GMT") == 819855000000 is true
    163 PASS Date.parse("wed(comment 1) (comment 2) dec 25 1995 1:30 gmt") == 819855000000 is true
    164 PASS Date.parse("We(comment 1) (comment 2) Dec 25 1995 1:30 GMT") == 819855000000 is true
    165 PASS Date.parse("WE(COMMENT 1) (COMMENT 2) DEC 25 1995 1:30 GMT") == 819855000000 is true
    166 PASS Date.parse("we(comment 1) (comment 2) dec 25 1995 1:30 gmt") == 819855000000 is true
    167 PASS successfullyParsed is true
    168 
    169 TEST COMPLETE
    170 
    171