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

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

Issue 10321006: More status updates. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 8 years, 7 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/operator6_test.dart ('k') | no next file » | 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) 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 class OperatorTest { 5 class OperatorTest {
6 static int i1, i2; 6 static int i1, i2;
7 7
8 OperatorTest() {} 8 OperatorTest() {}
9 9
10 static testMain() { 10 static testMain() {
11 var op1 = new Operator(1); 11 var op1 = new Operator(1);
12 var op2 = new Operator(2); 12 var op2 = new Operator(2);
13 Expect.equals(3, op1 + op2); 13 Expect.equals(3, op1 + op2);
14 Expect.equals(-1, op1 - op2); 14 Expect.equals(-1, op1 - op2);
15 Expect.equals(0.5, op1 / op2); 15 Expect.equals(0.5, op1 / op2);
16 Expect.equals(0, op1 ~/ op2); 16 Expect.equals(0, op1 ~/ op2);
17 Expect.equals(2, op1 * op2); 17 Expect.equals(2, op1 * op2);
18 Expect.equals(1, op1 % op2); 18 Expect.equals(1, op1 % op2);
19 Expect.equals(true, !(op1 == op2)); 19 Expect.equals(true, !(op1 == op2));
20 Expect.equals(true, op1 < op2); 20 Expect.equals(true, op1 < op2);
21 Expect.equals(true, !(op1 > op2)); 21 Expect.equals(true, !(op1 > op2));
22 Expect.equals(true, op1 <= op2); 22 Expect.equals(true, op1 <= op2);
23 Expect.equals(true, !(op1 >= op2)); 23 Expect.equals(true, !(op1 >= op2));
24 Expect.equals(3, (op1 | op2)); 24 Expect.equals(3, (op1 | op2));
25 Expect.equals(3, (op1 ^ op2)); 25 Expect.equals(3, (op1 ^ op2));
26 Expect.equals(0, (op1 & op2)); 26 Expect.equals(0, (op1 & op2));
27 Expect.equals(4, (op1 << op2)); 27 Expect.equals(4, (op1 << op2));
28 Expect.equals(0, (op1 >> op2)); 28 Expect.equals(0, (op1 >> op2));
29 Expect.equals(~1, ~op1);
30 Expect.equals(-1, -op1); 29 Expect.equals(-1, -op1);
31 30
32 op1.value += op2.value; 31 op1.value += op2.value;
33 Expect.equals(3, op1.value); 32 Expect.equals(3, op1.value);
34 33
35 op2.value += (op2.value += op2.value); 34 op2.value += (op2.value += op2.value);
36 Expect.equals(6, op2.value); 35 Expect.equals(6, op2.value);
37 36
38 op2.value -= (op2.value -= op2.value); 37 op2.value -= (op2.value -= op2.value);
39 Expect.equals(6, op2.value); 38 Expect.equals(6, op2.value);
(...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after
121 } 120 }
122 121
123 operator >>(Operator other) { 122 operator >>(Operator other) {
124 return value >> other.value; 123 return value >> other.value;
125 } 124 }
126 125
127 operator ~/(Operator other) { 126 operator ~/(Operator other) {
128 return value ~/ other.value; 127 return value ~/ other.value;
129 } 128 }
130 129
131 operator ~() {
132 return ~value;
133 }
134
135 operator negate() { 130 operator negate() {
136 return -value; 131 return -value;
137 } 132 }
138 } 133 }
139 134
140 main() { 135 main() {
141 OperatorTest.testMain(); 136 OperatorTest.testMain();
142 } 137 }
OLDNEW
« no previous file with comments | « tests/language/operator6_test.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698