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

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

Issue 12212016: Remove Expect from core library. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Add deprecation comment for ExpectException and revert one test. Created 7 years, 8 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/language/arithmetic2_test.dart ('k') | tests/language/arithmetic_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) 2013, the Dart project authors. Please see the AUTHORS file 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 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 // Test canonicalization of simple arithmetic equivalences. 4 // Test canonicalization of simple arithmetic equivalences.
5 5
6 import "package:expect/expect.dart";
7
6 main() { 8 main() {
7 for (var i = 0; i < 5000; i++) { 9 for (var i = 0; i < 5000; i++) {
8 Expect.isTrue(mul1double(i) is double); 10 Expect.isTrue(mul1double(i) is double);
9 Expect.equals(i.toDouble(), mul1double(i)); 11 Expect.equals(i.toDouble(), mul1double(i));
10 Expect.equals(0.0, mul0double(i)); 12 Expect.equals(0.0, mul0double(i));
11 Expect.equals(i.toDouble(), add0double(i)); 13 Expect.equals(i.toDouble(), add0double(i));
12 14
13 Expect.equals(i, mul1int(i)); 15 Expect.equals(i, mul1int(i));
14 Expect.equals(i, add0int(i)); 16 Expect.equals(i, add0int(i));
15 Expect.equals(0, mul0int(i)); 17 Expect.equals(0, mul0int(i));
(...skipping 11 matching lines...) Expand all
27 mul0double(x) => 0.0 * x; 29 mul0double(x) => 0.0 * x;
28 add0double(x) => 0.0 + x; 30 add0double(x) => 0.0 + x;
29 31
30 mul1int(x) => 1 * x; 32 mul1int(x) => 1 * x;
31 mul0int(x) => 0 * x; 33 mul0int(x) => 0 * x;
32 add0int(x) => 0 + x; 34 add0int(x) => 0 + x;
33 and0(x) => 0 & x; 35 and0(x) => 0 & x;
34 or0(x) => 0 | x; 36 or0(x) => 0 | x;
35 xor0(x) => 0 ^ x; 37 xor0(x) => 0 ^ x;
36 and1(x) => (-1) & x; 38 and1(x) => (-1) & x;
OLDNEW
« no previous file with comments | « tests/language/arithmetic2_test.dart ('k') | tests/language/arithmetic_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698