Opened 12 years ago

Closed 12 years ago

#5885 closed defect (fixed)

test_date_locale UT failure

Reported by: Adam Peller Owned by: Adam Peller
Priority: high Milestone: 1.1
Component: Date Version: 1.0
Keywords: Cc:
Blocked By: Blocking:

Description

Noticed when #5200 was fixed:

from tests.data.locale

PASSED test: format
     _AssertFailure: file:///users/peller/Sites/workspace/trunk4/dojo/_base/_loader/bootstrap.js:345 doh._AssertFailure: assertEqual() failed: expected |Fri Aug 11 0006 00:00:00 GMT-0400 (EDT)| but got |Fri Aug 11 2006 00:00:00 GMT-0400 (EDT)|
 doh._AssertFailure
     ERROR IN:
  (function (t) {var aug_11_2006 = new Date(2006, 7, 11, 0);var aug_11_06CE = new Date(2006, 7, 11, 0);aug_11_06CE.setFullYear(6);t.is(aug_11_2006, dojo.date.locale.parse("08/11/06", {formatLength: "short", selector: "date", locale: "en"}));t.is(aug_11_2006, dojo.date.locale.parse("8/11/06", {formatLength: "short", selector: "date", locale: "en"}));t.is(aug_11_2006, dojo.date.locale.parse("8/11/2006", {formatLength: "short", selector: "date", locale: "en"}));t.f(Boolean(dojo.date.locale.parse("8/11/2006", {formatLength: "short", selector: "date", locale: "en", strict: true})));t.is(aug_11_2006, dojo.date.locale.parse("Aug 11, 2006", {formatLength: "medium", selector: "date", locale: "en"}));t.is(aug_11_2006, dojo.date.locale.parse("Aug 11, 2006", {formatLength: "medium", selector: "date", locale: "en"}));t.is(aug_11_2006, dojo.date.locale.parse("Aug. 11, 2006", {formatLength: "medium", selector: "date", locale: "en"}));t.f(Boolean(dojo.date.locale.parse("Aug. 11, 2006", {formatLength: "medium", selector: "date", locale: "en", strict: true})));t.is(aug_11_06CE, dojo.date.locale.parse("Aug 11, 06", {formatLength: "medium", selector: "date", locale: "en"}));t.is(aug_11_2006, dojo.date.locale.parse("August 11, 2006", {formatLength: "long", selector: "date", locale: "en"}));t.is(aug_11_2006, dojo.date.locale.parse("Friday, August 11, 2006", {formatLength: "full", selector: "date", locale: "en"}));t.is(aug_11_2006, dojo.date.locale.parse(" August 11, 2006", {formatLength: "long", selector: "date", locale: "en"}));t.is(aug_11_2006, dojo.date.locale.parse("August 11, 2006", {formatLength: "long", selector: "date", locale: "en"}));t.is(aug_11_2006, dojo.date.locale.parse("August 11 , 2006", {formatLength: "long", selector: "date", locale: "en"}));t.is(aug_11_2006, dojo.date.locale.parse("August 11, 2006", {formatLength: "long", selector: "date", locale: "en"}));t.is(aug_11_2006, dojo.date.locale.parse("August 11, 2006 ", {formatLength: "long", selector: "date", locale: "en"}));t.f(Boolean(dojo.date.locale.parse("15/1/2005", {formatLength: "short", selector: "date", locale: "en"})));t.f(Boolean(dojo.date.locale.parse("Aug 32, 2006", {formatLength: "medium", selector: "date", locale: "en"})));t.is(aug_11_2006, dojo.date.locale.parse("11.08.06", {formatLength: "short", selector: "date", locale: "de"}));t.f(Boolean(dojo.date.locale.parse("11.8/06", {formatLength: "short", selector: "date", locale: "de"})));t.f(Boolean(dojo.date.locale.parse("11.8x06", {formatLength: "short", selector: "date", locale: "de"})));t.f(Boolean(dojo.date.locale.parse("11.13.06", {formatLength: "short", selector: "date", locale: "de"})));t.f(Boolean(dojo.date.locale.parse("11.0.06", {formatLength: "short", selector: "date", locale: "de"})));t.f(Boolean(dojo.date.locale.parse("32.08.06", {formatLength: "short", selector: "date", locale: "de"})));t.is(aug_11_2006, dojo.date.locale.parse("11/08/06", {formatLength: "short", selector: "date", locale: "es"}));t.is(aug_11_2006, dojo.date.locale.parse("11/8/06", {formatLength: "short", selector: "date", locale: "es"}));t.is(aug_11_2006, dojo.date.locale.parse("11/8/2006", {formatLength: "short", selector: "date", locale: "es"}));t.f(Boolean(dojo.date.locale.parse("11/8/2006", {formatLength: "short", selector: "date", locale: "es", strict: true})));t.is(aug_11_2006, dojo.date.locale.parse("11-ago-06", {formatLength: "medium", selector: "date", locale: "es"}));t.is(aug_11_2006, dojo.date.locale.parse("11-ago-2006", {formatLength: "medium", selector: "date", locale: "es"}));t.is(aug_11_2006, dojo.date.locale.parse("11-ago.-2006", {formatLength: "medium", selector: "date", locale: "es"}));t.f(Boolean(dojo.date.locale.parse("11-ago.-2006", {formatLength: "medium", selector: "date", locale: "es", strict: true})));t.is(aug_11_2006, dojo.date.locale.parse("11 de agosto de 2006", {formatLength: "long", selector: "date", locale: "es"}));t.is(aug_11_2006, dojo.date.locale.parse("11 de Agosto de 2006", {formatLength: "long", selector: "date", locale: "es"}));t.f(Boolean(dojo.date.locale.parse("11 de Agosto de 2006", {formatLength: "long", selector: "date", locale: "es", strict: true})));t.is(aug_11_2006, dojo.date.locale.parse("viernes 11 de agosto de 2006", {formatLength: "full", selector: "date", locale: "es"}));t.is(aug_11_2006, dojo.date.locale.parse("Viernes 11 de agosto de 2006", {formatLength: "full", selector: "date", locale: "es"}));t.f(Boolean(dojo.date.locale.parse("Viernes 11 de agosto de 2006", {formatLength: "full", selector: "date", locale: "es", strict: true})));t.is(aug_11_2006, dojo.date.locale.parse("06/08/11", {formatLength: "short", selector: "date", locale: "ja"}));t.is(aug_11_2006, dojo.date.locale.parse("06/8/11", {formatLength: "short", selector: "date", locale: "ja"}));t.is(aug_11_2006, dojo.date.locale.parse("2006/8/11", {formatLength: "short", selector: "date", locale: "ja"}));t.f(Boolean(dojo.date.locale.parse("2006/8/11", {formatLength: "short", selector: "date", locale: "ja", strict: true})));t.is(aug_11_2006, dojo.date.locale.parse("2006/08/11", {formatLength: "medium", selector: "date", locale: "ja"}));t.is(aug_11_2006, dojo.date.locale.parse("2006/8/11", {formatLength: "medium", selector: "date", locale: "ja"}));t.is(aug_11_2006, dojo.date.locale.parse("2006u5E748u670811u65E5", {formatLength: "long", selector: "date", locale: "ja"}));t.is(aug_11_2006, dojo.date.locale.parse("2006u5E748u670811u65E5u91D1u66DCu65E5", {formatLength: "full", selector: "date", locale: "ja"}));t.is(aug_11_2006, dojo.date.locale.parse(" 2006u5E748u670811u65E5u91D1u66DCu65E5 ", {formatLength: "full", selector: "date", locale: "ja"}));t.is(aug_11_2006, dojo.date.locale.parse("2006u5E74 8u670811u65E5 u91D1u66DCu65E5", {formatLength: "full", selector: "date", locale: "ja"}));t.is(aug_11_2006, dojo.date.locale.parse("u30002006u5E748u670811u65E5u91D1u66DCu65E5u3000", {formatLength: "full", selector: "date", locale: "ja"}));t.is(aug_11_2006, dojo.date.locale.parse("2006u5E74u30008u670811u65E5u3000u91D1u66DCu65E5", {formatLength: "full", selector: "date", locale: "ja"}));var apr_11_2006 = new Date(2006, 3, 11, 0);var options = {formatLength: "medium", selector: "date", locale: "fr-fr"};t.is(0, dojo.date.compare(apr_11_2006, dojo.date.locale.parse(dojo.date.locale.format(apr_11_2006, options), options)));t.is(0, dojo.date.compare(apr_11_2006, dojo.date.locale.parse("11 avr 06", options)));})
 FAILED test: parse_dates

Change History (3)

comment:1 Changed 12 years ago by Adam Peller

see #5465

comment:2 Changed 12 years ago by Adam Peller

(In [12491]) Refs #5885

comment:3 Changed 12 years ago by Adam Peller

Resolution: fixed
Status: newclosed

(In [12820]) Fix strict mode checking of year < 100CE in dojo.date.parse. Refs #4850. Also remove unsupported whitespace tests and invalid 'es' locale tests. Fixes #5885

Note: See TracTickets for help on using tickets.