| OLD | NEW |
| 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file |
| 2 // for details. All rights reserved. Use of this source code is governed by a | 2 // for details. All rights reserved. Use of this source code is governed by a |
| 3 // BSD-style license that can be found in the LICENSE file. | 3 // BSD-style license that can be found in the LICENSE file. |
| 4 | 4 |
| 5 library dart.io; |
| 6 |
| 5 import "package:expect/expect.dart"; | 7 import "package:expect/expect.dart"; |
| 6 import "dart:async"; | 8 import "dart:async"; |
| 9 import "dart:collection"; |
| 10 import "dart:convert"; |
| 7 import "dart:math"; | 11 import "dart:math"; |
| 8 import "dart:collection"; | 12 import "dart:typed_data"; |
| 13 import "dart:isolate"; |
| 9 | 14 |
| 15 part "../../../sdk/lib/io/bytes_builder.dart"; |
| 10 part "../../../sdk/lib/io/common.dart"; | 16 part "../../../sdk/lib/io/common.dart"; |
| 11 part "../../../sdk/lib/io/io_sink.dart"; | 17 part "../../../sdk/lib/io/crypto.dart"; |
| 18 part "../../../sdk/lib/io/data_transformer.dart"; |
| 19 part "../../../sdk/lib/io/directory.dart"; |
| 20 part "../../../sdk/lib/io/directory_impl.dart"; |
| 21 part "../../../sdk/lib/io/file.dart"; |
| 22 part "../../../sdk/lib/io/file_impl.dart"; |
| 23 part "../../../sdk/lib/io/file_system_entity.dart"; |
| 24 part "../../../sdk/lib/io/link.dart"; |
| 12 part "../../../sdk/lib/io/http.dart"; | 25 part "../../../sdk/lib/io/http.dart"; |
| 13 part "../../../sdk/lib/io/http_impl.dart"; | 26 part "../../../sdk/lib/io/http_impl.dart"; |
| 27 part "../../../sdk/lib/io/http_date.dart"; |
| 14 part "../../../sdk/lib/io/http_parser.dart"; | 28 part "../../../sdk/lib/io/http_parser.dart"; |
| 15 part "../../../sdk/lib/io/http_date.dart"; | 29 part "../../../sdk/lib/io/http_headers.dart"; |
| 30 part "../../../sdk/lib/io/http_session.dart"; |
| 31 part "../../../sdk/lib/io/io_service.dart"; |
| 32 part "../../../sdk/lib/io/io_sink.dart"; |
| 33 part "../../../sdk/lib/io/platform.dart"; |
| 34 part "../../../sdk/lib/io/platform_impl.dart"; |
| 35 part "../../../sdk/lib/io/secure_socket.dart"; |
| 36 part "../../../sdk/lib/io/secure_server_socket.dart"; |
| 16 part "../../../sdk/lib/io/socket.dart"; | 37 part "../../../sdk/lib/io/socket.dart"; |
| 17 | 38 |
| 18 void testParseHttpCookieDate() { | 39 void testParseHttpCookieDate() { |
| 19 Expect.throws(() => HttpDate._parseCookieDate("")); | 40 Expect.throws(() => HttpDate._parseCookieDate("")); |
| 20 | 41 |
| 21 test(int year, | 42 test(int year, |
| 22 int month, | 43 int month, |
| 23 int day, | 44 int day, |
| 24 int hours, | 45 int hours, |
| 25 int minutes, | 46 int minutes, |
| 26 int seconds, | 47 int seconds, |
| 27 String formatted) { | 48 String formatted) { |
| 28 DateTime date = | 49 DateTime date = |
| 29 new DateTime.utc(year, month, day, hours, minutes, seconds, 0); | 50 new DateTime.utc(year, month, day, hours, minutes, seconds, 0); |
| 30 Expect.equals(date, HttpDate._parseCookieDate(formatted)); | 51 Expect.equals(date, HttpDate._parseCookieDate(formatted)); |
| 31 } | 52 } |
| 32 | 53 |
| 33 test(2012, DateTime.JUNE, 19, 14, 15, 01, "tue, 19-jun-12 14:15:01 gmt"); | 54 test(2012, DateTime.JUNE, 19, 14, 15, 01, "tue, 19-jun-12 14:15:01 gmt"); |
| 34 test(2021, DateTime.JUNE, 09, 10, 18, 14, "Wed, 09-Jun-2021 10:18:14 GMT"); | 55 test(2021, DateTime.JUNE, 09, 10, 18, 14, "Wed, 09-Jun-2021 10:18:14 GMT"); |
| 35 test(2021, DateTime.JANUARY, 13, 22, 23, 01, "Wed, 13-Jan-2021 22:23:01 GMT"); | 56 test(2021, DateTime.JANUARY, 13, 22, 23, 01, "Wed, 13-Jan-2021 22:23:01 GMT"); |
| 36 test(2013, DateTime.JANUARY, 15, 21, 47, 38, "Tue, 15-Jan-2013 21:47:38 GMT"); | 57 test(2013, DateTime.JANUARY, 15, 21, 47, 38, "Tue, 15-Jan-2013 21:47:38 GMT"); |
| 37 test(1970, DateTime.JANUARY, 01, 00, 00, 01, "Thu, 01-Jan-1970 00:00:01 GMT"); | 58 test(1970, DateTime.JANUARY, 01, 00, 00, 01, "Thu, 01-Jan-1970 00:00:01 GMT"); |
| 38 } | 59 } |
| 39 | 60 |
| 40 void main() { | 61 void main() { |
| 41 testParseHttpCookieDate(); | 62 testParseHttpCookieDate(); |
| 42 } | 63 } |
| OLD | NEW |