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

Side by Side Diff: tests/corelib/date_time9_test.dart

Issue 2984063002: Migrate test block 5 to Dart 2.0. (Closed)
Patch Set: merge with head Created 3 years, 5 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
« no previous file with comments | « tests/corelib/date_time8_test.dart ('k') | tests/corelib/date_time_parse_test.dart » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file
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.
4
5 import "package:expect/expect.dart";
6
7 main() {
8 var dt = new DateTime.now();
9 Expect.isTrue(dt is Comparable);
10
11 var dt2 = new DateTime.fromMillisecondsSinceEpoch(100);
12 var dt3 = new DateTime.fromMillisecondsSinceEpoch(200, isUtc: true);
13 var dt3b = new DateTime.fromMillisecondsSinceEpoch(200);
14 var dt4 = new DateTime.fromMillisecondsSinceEpoch(300);
15 var dt5 = new DateTime.fromMillisecondsSinceEpoch(400, isUtc: true);
16 var dt5b = new DateTime.fromMillisecondsSinceEpoch(400);
17
18 Expect.isTrue(dt2.compareTo(dt2) == 0);
19 Expect.isTrue(dt3.compareTo(dt3) == 0);
20 Expect.isTrue(dt3b.compareTo(dt3b) == 0);
21 Expect.isTrue(dt4.compareTo(dt4) == 0);
22 Expect.isTrue(dt5.compareTo(dt5) == 0);
23 Expect.isTrue(dt5b.compareTo(dt5b) == 0);
24
25 // Time zones don't have any effect.
26 Expect.isTrue(dt3.compareTo(dt3b) == 0);
27 Expect.isTrue(dt5.compareTo(dt5b) == 0);
28
29 Expect.isTrue(dt2.compareTo(dt3) < 0);
30 Expect.isTrue(dt3.compareTo(dt4) < 0);
31 Expect.isTrue(dt4.compareTo(dt5) < 0);
32
33 Expect.isTrue(dt2.compareTo(dt3b) < 0);
34 Expect.isTrue(dt4.compareTo(dt5b) < 0);
35
36 Expect.isTrue(dt3.compareTo(dt2) > 0);
37 Expect.isTrue(dt4.compareTo(dt3) > 0);
38 Expect.isTrue(dt5.compareTo(dt4) > 0);
39
40 Expect.isTrue(dt3b.compareTo(dt2) > 0);
41 Expect.isTrue(dt5b.compareTo(dt4) > 0);
42 }
OLDNEW
« no previous file with comments | « tests/corelib/date_time8_test.dart ('k') | tests/corelib/date_time_parse_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698