| 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 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 69 | 69 |
| 70 var y = 100; | 70 var y = 100; |
| 71 y += 1 << 3; | 71 y += 1 << 3; |
| 72 Expect.equals(108, y); | 72 Expect.equals(108, y); |
| 73 y *= 2 + 1; | 73 y *= 2 + 1; |
| 74 Expect.equals(324, y); | 74 Expect.equals(324, y); |
| 75 y -= 3 - 2; | 75 y -= 3 - 2; |
| 76 Expect.equals(323, y); | 76 Expect.equals(323, y); |
| 77 y += 3 * 4; | 77 y += 3 * 4; |
| 78 Expect.equals(335, y); | 78 Expect.equals(335, y); |
| 79 |
| 80 var a = [1, 2, 3]; |
| 81 var ix = 0; |
| 82 a[ix] |= 12; |
| 83 Expect.equals(13, a[ix]); |
| 79 } | 84 } |
| 80 | 85 |
| 81 static var f; | 86 static var f; |
| 82 var instf; | 87 var instf; |
| 83 } | 88 } |
| 84 main() { | 89 main() { |
| 85 AssignOpTest.testMain(); | 90 for (int i = 0; i < 2000; i++) { |
| 91 AssignOpTest.testMain(); |
| 92 } |
| 86 } | 93 } |
| OLD | NEW |