| 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 // Dart test program for testing assign operators. | 4 // Dart test program for testing assign operators. |
| 5 | 5 |
| 6 | 6 |
| 7 class AssignOpTest { | 7 class AssignOpTest { |
| 8 AssignOpTest() {} | 8 AssignOpTest() {} |
| 9 | 9 |
| 10 static testMain() { | 10 static testMain() { |
| (...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 59 x >>= 3; | 59 x >>= 3; |
| 60 Expect.equals(0x1F, x); | 60 Expect.equals(0x1F, x); |
| 61 x <<= 3; | 61 x <<= 3; |
| 62 Expect.equals(0xF8, x); | 62 Expect.equals(0xF8, x); |
| 63 x |= 0xF00; | 63 x |= 0xF00; |
| 64 Expect.equals(0xFF8, x); | 64 Expect.equals(0xFF8, x); |
| 65 x &=0xF0; | 65 x &=0xF0; |
| 66 Expect.equals(0xF0, x); | 66 Expect.equals(0xF0, x); |
| 67 x ^=0x11; | 67 x ^=0x11; |
| 68 Expect.equals(0xE1, x); | 68 Expect.equals(0xE1, x); |
| 69 |
| 70 var y = 100; |
| 71 y += 1 << 3; |
| 72 Expect.equals(108, y); |
| 73 y *= 2 + 1; |
| 74 Expect.equals(324, y); |
| 75 y -= 3 - 2; |
| 76 Expect.equals(323, y); |
| 77 y += 3 * 4; |
| 78 Expect.equals(335, y); |
| 69 } | 79 } |
| 70 | 80 |
| 71 static var f; | 81 static var f; |
| 72 var instf; | 82 var instf; |
| 73 } | 83 } |
| 74 main() { | 84 main() { |
| 75 AssignOpTest.testMain(); | 85 AssignOpTest.testMain(); |
| 76 } | 86 } |
| OLD | NEW |