OLD | NEW |
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 import "package:expect/expect.dart"; | 5 import "package:expect/expect.dart"; |
6 | 6 |
7 int zero() { return 0; } | 7 int zero() { |
8 int one() { return 1; } | 8 return 0; |
9 int minus1() { return 0 - 1; } | 9 } |
10 int two() { return 2; } | 10 |
11 int three() { return 3; } | 11 int one() { |
12 int five() { return 5; } | 12 return 1; |
13 int minus5() { return 0 - 5; } | 13 } |
14 int ninetyNine() { return 99; } | 14 |
15 int four99() { return 499; } | 15 int minus1() { |
16 int four99times99() { return 499 * 99; } | 16 return 0 - 1; |
17 int four99times99plus1() { return 499 * 99 + 1; } | 17 } |
| 18 |
| 19 int two() { |
| 20 return 2; |
| 21 } |
| 22 |
| 23 int three() { |
| 24 return 3; |
| 25 } |
| 26 |
| 27 int five() { |
| 28 return 5; |
| 29 } |
| 30 |
| 31 int minus5() { |
| 32 return 0 - 5; |
| 33 } |
| 34 |
| 35 int ninetyNine() { |
| 36 return 99; |
| 37 } |
| 38 |
| 39 int four99() { |
| 40 return 499; |
| 41 } |
| 42 |
| 43 int four99times99() { |
| 44 return 499 * 99; |
| 45 } |
| 46 |
| 47 int four99times99plus1() { |
| 48 return 499 * 99 + 1; |
| 49 } |
18 | 50 |
19 void addTest() { | 51 void addTest() { |
20 var m1 = 0 - 1; | 52 var m1 = 0 - 1; |
21 var x = 0; | 53 var x = 0; |
22 x += 0; | 54 x += 0; |
23 Expect.equals(0, x); | 55 Expect.equals(0, x); |
24 x += one(); | 56 x += one(); |
25 Expect.equals(1, x); | 57 Expect.equals(1, x); |
26 x += m1; | 58 x += m1; |
27 Expect.equals(0, x); | 59 Expect.equals(0, x); |
(...skipping 118 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
146 mulTest(); | 178 mulTest(); |
147 divTest(); | 179 divTest(); |
148 tdivTest(); | 180 tdivTest(); |
149 modTest(); | 181 modTest(); |
150 shlTest(); | 182 shlTest(); |
151 shrTest(); | 183 shrTest(); |
152 andTest(); | 184 andTest(); |
153 orTest(); | 185 orTest(); |
154 xorTest(); | 186 xorTest(); |
155 } | 187 } |
OLD | NEW |