Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(268)

Side by Side Diff: packages/intl/test/date_time_strict_test.dart

Issue 2989763002: Update charted to 0.4.8 and roll (Closed)
Patch Set: Removed Cutch from list of reviewers Created 3 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 /// Tests for the strict option when parsing dates and times, which are 5 /// Tests for the strict option when parsing dates and times, which are
6 /// relatively locale-independent, depending only on the being a valid date 6 /// relatively locale-independent, depending only on the being a valid date
7 /// and consuming all the input data. 7 /// and consuming all the input data.
8 library date_time_strict_test; 8 library date_time_strict_test;
9 9
10 import 'package:intl/intl.dart'; 10 import 'package:intl/intl.dart';
11 import 'package:unittest/unittest.dart'; 11 import 'package:test/test.dart';
12 12
13 main() { 13 main() {
14 test("All input consumed", () { 14 test("All input consumed", () {
15 var format = new DateFormat.yMMMd(); 15 var format = new DateFormat.yMMMd();
16 var date = new DateTime(2014, 9, 3); 16 var date = new DateTime(2014, 9, 3);
17 var formatted = 'Sep 3, 2014'; 17 var formatted = 'Sep 3, 2014';
18 expect(format.format(date), formatted); 18 expect(format.format(date), formatted);
19 var parsed = format.parseStrict(formatted); 19 var parsed = format.parseStrict(formatted);
20 expect(parsed, date); 20 expect(parsed, date);
21 21
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after
70 check("25:00:00"); 70 check("25:00:00");
71 check("0:-1:00"); 71 check("0:-1:00");
72 check("0:60:00"); 72 check("0:60:00");
73 expect(format.parseStrict("0:59:00"), new DateTime(1970, 1, 1, 0, 59)); 73 expect(format.parseStrict("0:59:00"), new DateTime(1970, 1, 1, 0, 59));
74 check("0:0:-1"); 74 check("0:0:-1");
75 check("0:0:60"); 75 check("0:0:60");
76 check("14:0:60"); 76 check("14:0:60");
77 expect(format.parseStrict("14:0:59"), new DateTime(1970, 1, 1, 14, 0, 59)); 77 expect(format.parseStrict("14:0:59"), new DateTime(1970, 1, 1, 14, 0, 59));
78 }); 78 });
79 } 79 }
OLDNEW
« no previous file with comments | « packages/intl/test/date_time_loose_parsing_test.dart ('k') | packages/intl/test/find_default_locale_browser_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698