OLD | NEW |
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 | 4 |
5 final x = 19; | 5 const x = 19; |
6 final y = 3; | 6 const y = 3; |
7 final g1 = x + y; | 7 const g1 = x + y; |
8 final g2 = x * y; | 8 const g2 = x * y; |
9 final g3 = x / y; | 9 const g3 = x / y; |
10 final g4 = x ~/ y; | 10 const g4 = x ~/ y; |
11 final g5 = x << y; | 11 const g5 = x << y; |
12 final g6 = x >> y; | 12 const g6 = x >> y; |
13 final g7 = ~x; | 13 const g7 = ~x; |
14 final g8 = -x; | 14 const g8 = -x; |
15 final g9 = x < y; | 15 const g9 = x < y; |
16 final g10 = x <= y; | 16 const g10 = x <= y; |
17 final g11 = x <= x; | 17 const g11 = x <= x; |
18 final g12 = x > y; | 18 const g12 = x > y; |
19 final g13 = x >= y; | 19 const g13 = x >= y; |
20 final g14 = x >= x; | 20 const g14 = x >= x; |
21 final g15 = x == y; | 21 const g15 = x == y; |
22 final g16 = x == x; | 22 const g16 = x == x; |
23 final g17 = x != y; | 23 const g17 = x != y; |
24 final g18 = x != x; | 24 const g18 = x != x; |
25 final g19 = x | y; | 25 const g19 = x | y; |
26 final g20 = x & y; | 26 const g20 = x & y; |
27 final g21 = x ^ y; | 27 const g21 = x ^ y; |
28 final g22 = g1 + g2 + g4 + g5 + g6 + g7 + g8; | 28 const g22 = g1 + g2 + g4 + g5 + g6 + g7 + g8; |
29 final g23 = x % y; | 29 const g23 = x % y; |
30 | 30 |
31 main() { | 31 main() { |
32 Expect.equals(22, g1); | 32 Expect.equals(22, g1); |
33 Expect.equals(57, g2); | 33 Expect.equals(57, g2); |
34 Expect.equals(6.333333333333333333333333333, g3); | 34 Expect.equals(6.333333333333333333333333333, g3); |
35 Expect.equals(6, g4); | 35 Expect.equals(6, g4); |
36 Expect.equals(152, g5); | 36 Expect.equals(152, g5); |
37 Expect.equals(2, g6); | 37 Expect.equals(2, g6); |
38 Expect.equals(-20, g7); | 38 Expect.equals(-20, g7); |
39 Expect.equals(-19, g8); | 39 Expect.equals(-19, g8); |
40 Expect.equals(false, g9); | 40 Expect.equals(false, g9); |
41 Expect.equals(false, g10); | 41 Expect.equals(false, g10); |
42 Expect.equals(true, g11); | 42 Expect.equals(true, g11); |
43 Expect.equals(true, g12); | 43 Expect.equals(true, g12); |
44 Expect.equals(true, g13); | 44 Expect.equals(true, g13); |
45 Expect.equals(true, g14); | 45 Expect.equals(true, g14); |
46 Expect.equals(false, g15); | 46 Expect.equals(false, g15); |
47 Expect.equals(true, g16); | 47 Expect.equals(true, g16); |
48 Expect.equals(true, g17); | 48 Expect.equals(true, g17); |
49 Expect.equals(false, g18); | 49 Expect.equals(false, g18); |
50 Expect.equals(19, g19); | 50 Expect.equals(19, g19); |
51 Expect.equals(3, g20); | 51 Expect.equals(3, g20); |
52 Expect.equals(16, g21); | 52 Expect.equals(16, g21); |
53 Expect.equals(200, g22); | 53 Expect.equals(200, g22); |
54 Expect.equals(1, g23); | 54 Expect.equals(1, g23); |
55 } | 55 } |
OLD | NEW |