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

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

Issue 11770004: Rename Date to DateTime. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Address comments and keep Backwards-compatibility class Date. Created 7 years, 11 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 | Annotate | Revision Log
« no previous file with comments | « tests/compiler/dart2js_extra/mirror_test.dart ('k') | tests/corelib/date_time2_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
1 // Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2011, 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 /** 5 /**
6 * A test of simple runtime behavior on numbers, strings and lists with 6 * A test of simple runtime behavior on numbers, strings and lists with
7 * a focus on both correct behavior and runtime errors. 7 * a focus on both correct behavior and runtime errors.
8 * 8 *
9 * This file is written to use minimal type declarations to match a 9 * This file is written to use minimal type declarations to match a
10 * typical dynamic language coding style. 10 * typical dynamic language coding style.
(...skipping 235 matching lines...) Expand 10 before | Expand all | Expand 10 after
246 assertEquals(d.keys.length, 2); 246 assertEquals(d.keys.length, 2);
247 assertEquals(d.values.length, 2); 247 assertEquals(d.values.length, 2);
248 248
249 d['g'] = null; 249 d['g'] = null;
250 assertEquals(d.containsKey('g'), true); 250 assertEquals(d.containsKey('g'), true);
251 assertEquals(d['g'], null); 251 assertEquals(d['g'], null);
252 } 252 }
253 253
254 static testDateMethods() { 254 static testDateMethods() {
255 var msec = 115201000; 255 var msec = 115201000;
256 var d = new Date.fromMillisecondsSinceEpoch(msec, isUtc: true); 256 var d = new DateTime.fromMillisecondsSinceEpoch(msec, isUtc: true);
257 assertEquals(d.second, 1); 257 assertEquals(d.second, 1);
258 assertEquals(d.year, 1970); 258 assertEquals(d.year, 1970);
259 259
260 d = new Date.now(); 260 d = new DateTime.now();
261 assertEquals(d.year >= 2011, true); 261 assertEquals(d.year >= 2011, true);
262 } 262 }
263 263
264 static testLiterals() { 264 static testLiterals() {
265 true.toString(); 265 true.toString();
266 1.0.toString(); 266 1.0.toString();
267 .5.toString(); 267 .5.toString();
268 1.toString(); 268 1.toString();
269 if (false) { 269 if (false) {
270 // Depends on http://b/4198808. 270 // Depends on http://b/4198808.
271 null.toString(); 271 null.toString();
272 } 272 }
273 '${null}'.toString(); 273 '${null}'.toString();
274 '${true}'.toString(); 274 '${true}'.toString();
275 '${false}'.toString(); 275 '${false}'.toString();
276 ''.toString(); 276 ''.toString();
277 ''.endsWith(''); 277 ''.endsWith('');
278 } 278 }
279 } 279 }
280 280
281 main() { 281 main() {
282 CoreRuntimeTypesTest.testMain(); 282 CoreRuntimeTypesTest.testMain();
283 } 283 }
OLDNEW
« no previous file with comments | « tests/compiler/dart2js_extra/mirror_test.dart ('k') | tests/corelib/date_time2_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698