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

Side by Side Diff: tests/language/arithmetic_test.dart

Issue 11191078: Make hashCode a getter and not a method. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Update status file with co19 issue number. Created 8 years, 1 month 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
OLDNEW
1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2012, 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 // Dart test program to test arithmetic operations. 4 // Dart test program to test arithmetic operations.
5 5
6 #library('arithmetic_test'); 6 #library('arithmetic_test');
7 #import('dart:math'); 7 #import('dart:math');
8 8
9 class ArithmeticTest { 9 class ArithmeticTest {
10 10
(...skipping 388 matching lines...) Expand 10 before | Expand all | Expand 10 after
399 399
400 // Min/max 400 // Min/max
401 Expect.equals(1, min(1, 12)); 401 Expect.equals(1, min(1, 12));
402 Expect.equals(12, max(1, 12)); 402 Expect.equals(12, max(1, 12));
403 Expect.equals(1.0, min(1.0, 12.0)); 403 Expect.equals(1.0, min(1.0, 12.0));
404 Expect.equals(12.0, max(1.0, 12.0)); 404 Expect.equals(12.0, max(1.0, 12.0));
405 Expect.equals(false, 1.0 < min(1.0, 12.0)); 405 Expect.equals(false, 1.0 < min(1.0, 12.0));
406 Expect.equals(true, 1.0 < max(1.0, 12.0)); 406 Expect.equals(true, 1.0 < max(1.0, 12.0));
407 407
408 // Hashcode 408 // Hashcode
409 Expect.equals(false, (3.4).hashCode() == (1.2).hashCode()); 409 Expect.equals(false, (3.4).hashCode == (1.2).hashCode);
410 Expect.equals(true, (1.2).hashCode() == (1.2).hashCode()); 410 Expect.equals(true, (1.2).hashCode == (1.2).hashCode);
411 Expect.equals(false, (3).hashCode() == (1).hashCode()); 411 Expect.equals(false, (3).hashCode == (1).hashCode);
412 Expect.equals(true, (10).hashCode() == (10).hashCode()); 412 Expect.equals(true, (10).hashCode == (10).hashCode);
413 } 413 }
414 414
415 static testMain() { 415 static testMain() {
416 for (int i = 0; i < 1500; i++) { 416 for (int i = 0; i < 1500; i++) {
417 runOne(); 417 runOne();
418 } 418 }
419 } 419 }
420 } 420 }
421 421
422 main() { 422 main() {
423 ArithmeticTest.testMain(); 423 ArithmeticTest.testMain();
424 } 424 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698