| Index: tests/standalone/io/http_date_test.dart
|
| diff --git a/tests/standalone/io/http_date_test.dart b/tests/standalone/io/http_date_test.dart
|
| index d4bc05851fdc83cd171f231551915894d25f6613..c5b36e22b9078be4435b1767f31429e03192dcfb 100644
|
| --- a/tests/standalone/io/http_date_test.dart
|
| +++ b/tests/standalone/io/http_date_test.dart
|
| @@ -16,19 +16,19 @@ part "../../../sdk/lib/io/http_parser.dart";
|
| part "../../../sdk/lib/io/http_utils.dart";
|
|
|
| void testParseHttpDate() {
|
| - Date date;
|
| - date = new Date.utc(1999, Date.JUN, 11, 18, 46, 53, 0);
|
| + DateTime date;
|
| + date = new DateTime.utc(1999, DateTime.JUN, 11, 18, 46, 53, 0);
|
| Expect.equals(date, _HttpUtils.parseDate("Fri, 11 Jun 1999 18:46:53 GMT"));
|
| Expect.equals(date, _HttpUtils.parseDate("Friday, 11-Jun-1999 18:46:53 GMT"));
|
| Expect.equals(date, _HttpUtils.parseDate("Fri Jun 11 18:46:53 1999"));
|
|
|
| - date = new Date.utc(1970, Date.JAN, 1, 0, 0, 0, 0);
|
| + date = new DateTime.utc(1970, DateTime.JAN, 1, 0, 0, 0, 0);
|
| Expect.equals(date, _HttpUtils.parseDate("Thu, 1 Jan 1970 00:00:00 GMT"));
|
| Expect.equals(date,
|
| _HttpUtils.parseDate("Thursday, 1-Jan-1970 00:00:00 GMT"));
|
| Expect.equals(date, _HttpUtils.parseDate("Thu Jan 1 00:00:00 1970"));
|
|
|
| - date = new Date.utc(2012, Date.MAR, 5, 23, 59, 59, 0);
|
| + date = new DateTime.utc(2012, DateTime.MAR, 5, 23, 59, 59, 0);
|
| Expect.equals(date, _HttpUtils.parseDate("Mon, 5 Mar 2012 23:59:59 GMT"));
|
| Expect.equals(date, _HttpUtils.parseDate("Monday, 5-Mar-2012 23:59:59 GMT"));
|
| Expect.equals(date, _HttpUtils.parseDate("Mon Mar 5 23:59:59 2012"));
|
| @@ -42,17 +42,17 @@ void testFormatParseHttpDate() {
|
| int minutes,
|
| int seconds,
|
| String expectedFormatted) {
|
| - Date date;
|
| + DateTime date;
|
| String formatted;
|
| - date = new Date.utc(year, month, day, hours, minutes, seconds, 0);
|
| + date = new DateTime.utc(year, month, day, hours, minutes, seconds, 0);
|
| formatted = _HttpUtils.formatDate(date);
|
| Expect.equals(expectedFormatted, formatted);
|
| Expect.equals(date, _HttpUtils.parseDate(formatted));
|
| }
|
|
|
| - test(1999, Date.JUN, 11, 18, 46, 53, "Fri, 11 Jun 1999 18:46:53 GMT");
|
| - test(1970, Date.JAN, 1, 0, 0, 0, "Thu, 1 Jan 1970 00:00:00 GMT");
|
| - test(2012, Date.MAR, 5, 23, 59, 59, "Mon, 5 Mar 2012 23:59:59 GMT");
|
| + test(1999, DateTime.JUN, 11, 18, 46, 53, "Fri, 11 Jun 1999 18:46:53 GMT");
|
| + test(1970, DateTime.JAN, 1, 0, 0, 0, "Thu, 1 Jan 1970 00:00:00 GMT");
|
| + test(2012, DateTime.MAR, 5, 23, 59, 59, "Mon, 5 Mar 2012 23:59:59 GMT");
|
| }
|
|
|
| void testParseHttpDateFailures() {
|
| @@ -96,15 +96,15 @@ void testParseHttpCookieDate() {
|
| int minutes,
|
| int seconds,
|
| String formatted) {
|
| - Date date = new Date.utc(year, month, day, hours, minutes, seconds, 0);
|
| + DateTime date = new DateTime.utc(year, month, day, hours, minutes, seconds, 0);
|
| Expect.equals(date, _HttpUtils.parseCookieDate(formatted));
|
| }
|
|
|
| - test(2012, Date.JUN, 19, 14, 15, 01, "tue, 19-jun-12 14:15:01 gmt");
|
| - test(2021, Date.JUN, 09, 10, 18, 14, "Wed, 09-Jun-2021 10:18:14 GMT");
|
| - test(2021, Date.JAN, 13, 22, 23, 01, "Wed, 13-Jan-2021 22:23:01 GMT");
|
| - test(2013, Date.JAN, 15, 21, 47, 38, "Tue, 15-Jan-2013 21:47:38 GMT");
|
| - test(1970, Date.JAN, 01, 00, 00, 01, "Thu, 01-Jan-1970 00:00:01 GMT");
|
| + test(2012, DateTime.JUN, 19, 14, 15, 01, "tue, 19-jun-12 14:15:01 gmt");
|
| + test(2021, DateTime.JUN, 09, 10, 18, 14, "Wed, 09-Jun-2021 10:18:14 GMT");
|
| + test(2021, DateTime.JAN, 13, 22, 23, 01, "Wed, 13-Jan-2021 22:23:01 GMT");
|
| + test(2013, DateTime.JAN, 15, 21, 47, 38, "Tue, 15-Jan-2013 21:47:38 GMT");
|
| + test(1970, DateTime.JAN, 01, 00, 00, 01, "Thu, 01-Jan-1970 00:00:01 GMT");
|
| }
|
|
|
| void main() {
|
|
|