Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(75)

Side by Side Diff: test/mjsunit/date-parse.js

Issue 1240093005: Fix check for a date with a 24th hour (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Fix testcases Created 5 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« src/dateparser.cc ('K') | « src/dateparser.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2008 the V8 project authors. All rights reserved. 1 // Copyright 2008 the V8 project authors. All rights reserved.
2 // Redistribution and use in source and binary forms, with or without 2 // Redistribution and use in source and binary forms, with or without
3 // modification, are permitted provided that the following conditions are 3 // modification, are permitted provided that the following conditions are
4 // met: 4 // met:
5 // 5 //
6 // * Redistributions of source code must retain the above copyright 6 // * Redistributions of source code must retain the above copyright
7 // notice, this list of conditions and the following disclaimer. 7 // notice, this list of conditions and the following disclaimer.
8 // * Redistributions in binary form must reproduce the above 8 // * Redistributions in binary form must reproduce the above
9 // copyright notice, this list of conditions and the following 9 // copyright notice, this list of conditions and the following
10 // disclaimer in the documentation and/or other materials provided 10 // disclaimer in the documentation and/or other materials provided
(...skipping 226 matching lines...) Expand 10 before | Expand all | Expand 10 after
237 ['2000-01-01T08:00:00.000Z', 946713600000], 237 ['2000-01-01T08:00:00.000Z', 946713600000],
238 ['2000-01-01T08:00:00Z', 946713600000], 238 ['2000-01-01T08:00:00Z', 946713600000],
239 ['2000-01-01T08:00Z', 946713600000], 239 ['2000-01-01T08:00Z', 946713600000],
240 ['2000-01T08:00:00.000Z', 946713600000], 240 ['2000-01T08:00:00.000Z', 946713600000],
241 ['2000T08:00:00.000Z', 946713600000], 241 ['2000T08:00:00.000Z', 946713600000],
242 ['2000T08:00Z', 946713600000], 242 ['2000T08:00Z', 946713600000],
243 ['2000-01T00:00:00.000-08:00', 946713600000], 243 ['2000-01T00:00:00.000-08:00', 946713600000],
244 ['2000-01T08:00:00.001Z', 946713600001], 244 ['2000-01T08:00:00.001Z', 946713600001],
245 ['2000-01T08:00:00.099Z', 946713600099], 245 ['2000-01T08:00:00.099Z', 946713600099],
246 ['2000-01T08:00:00.999Z', 946713600999], 246 ['2000-01T08:00:00.999Z', 946713600999],
247 ['2000-01T00:00:00.001-08:00', 946713600001]]; 247 ['2000-01T00:00:00.001-08:00', 946713600001],
248 ['2000-01-01T24:00', 946771200000],
249 ['2000-01-01T24:00:00', 946771200000],
250 ['2000-01-01T24:00:00.000', 946771200000],
251 ['2000-01-01T24:00:00.000Z', 946771200000]];
248 252
249 var testCasesES5MiscNegative = [ 253 var testCasesES5MiscNegative = [
250 '2000-01-01TZ', 254 '2000-01-01TZ',
251 '2000-01-01T60Z', 255 '2000-01-01T60Z',
252 '2000-01-01T60:60Z', 256 '2000-01-01T60:60Z',
253 '2000-01-0108:00Z', 257 '2000-01-0108:00Z',
254 '2000-01-01T08Z']; 258 '2000-01-01T08Z',
259 '2000-01-01T24:01',
260 '2000-01-01T24:00:01',
261 '2000-01-01T24:00:00.001',
262 '2000-01-01T24:00:00.999Z'];
255 263
256 264
257 // Run all the tests. 265 // Run all the tests.
258 testCasesUT.forEach(testDateParse); 266 testCasesUT.forEach(testDateParse);
259 testCasesGMT.forEach(testDateParse); 267 testCasesGMT.forEach(testDateParse);
260 testCasesEST.forEach(testDateParse); 268 testCasesEST.forEach(testDateParse);
261 testCasesEDT.forEach(testDateParse); 269 testCasesEDT.forEach(testDateParse);
262 testCasesCST.forEach(testDateParse); 270 testCasesCST.forEach(testDateParse);
263 testCasesCDT.forEach(testDateParse); 271 testCasesCDT.forEach(testDateParse);
264 testCasesMST.forEach(testDateParse); 272 testCasesMST.forEach(testDateParse);
(...skipping 23 matching lines...) Expand all
288 'May 25 2008 1:30 (PM)) UTC', // Bad unmatched ')' after number. 296 'May 25 2008 1:30 (PM)) UTC', // Bad unmatched ')' after number.
289 'May 25 2008 1:30( )AM (PM)', // 297 'May 25 2008 1:30( )AM (PM)', //
290 'a1', // Issue 126448, 53209. 298 'a1', // Issue 126448, 53209.
291 'nasfdjklsfjoaifg1', 299 'nasfdjklsfjoaifg1',
292 'x_2', 300 'x_2',
293 'May 25 2008 AAA (GMT)']; // Unknown word after number. 301 'May 25 2008 AAA (GMT)']; // Unknown word after number.
294 302
295 testCasesNegative.forEach(function (s) { 303 testCasesNegative.forEach(function (s) {
296 assertTrue(isNaN(Date.parse(s)), s + " is not NaN."); 304 assertTrue(isNaN(Date.parse(s)), s + " is not NaN.");
297 }); 305 });
OLDNEW
« src/dateparser.cc ('K') | « src/dateparser.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698