OLD | NEW |
1 // Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2014, 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 http_parser.http_date_test; | 5 library http_parser.http_date_test; |
6 | 6 |
7 import 'package:http_parser/http_parser.dart'; | 7 import 'package:http_parser/http_parser.dart'; |
8 import 'package:unittest/unittest.dart'; | 8 import 'package:test/test.dart'; |
9 | 9 |
10 void main() { | 10 void main() { |
11 group('format', () { | 11 group('format', () { |
12 test('many values with 9', () { | 12 test('many values with 9', () { |
13 var date = new DateTime.utc(2014, 9, 9, 9, 9, 9); | 13 var date = new DateTime.utc(2014, 9, 9, 9, 9, 9); |
14 var formatted = formatHttpDate(date); | 14 var formatted = formatHttpDate(date); |
15 | 15 |
16 expect(formatted, 'Tue, 09 Sep 2014 09:09:09 GMT'); | 16 expect(formatted, 'Tue, 09 Sep 2014 09:09:09 GMT'); |
17 var parsed = parseHttpDate(formatted); | 17 var parsed = parseHttpDate(formatted); |
18 | 18 |
(...skipping 319 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
338 throwsFormatException); | 338 throwsFormatException); |
339 }); | 339 }); |
340 | 340 |
341 test("disallows trailing whitespace", () { | 341 test("disallows trailing whitespace", () { |
342 expect(() => parseHttpDate("Sun November 0 08:49:37 1994 "), | 342 expect(() => parseHttpDate("Sun November 0 08:49:37 1994 "), |
343 throwsFormatException); | 343 throwsFormatException); |
344 }); | 344 }); |
345 }); | 345 }); |
346 }); | 346 }); |
347 } | 347 } |
OLD | NEW |