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