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

Unified Diff: tests/language/src/OperatorTest.dart

Issue 10248007: test rename overhaul: step 8 - language tests (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 8 years, 8 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « tests/language/src/OperatorIndexEvaluationOrderTest.dart ('k') | tests/language/src/OptimizationTest.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tests/language/src/OperatorTest.dart
diff --git a/tests/language/src/OperatorTest.dart b/tests/language/src/OperatorTest.dart
deleted file mode 100644
index e9f74c701154c8a23b29f53c91a079c4a81a5d17..0000000000000000000000000000000000000000
--- a/tests/language/src/OperatorTest.dart
+++ /dev/null
@@ -1,142 +0,0 @@
-// Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file
-// for details. All rights reserved. Use of this source code is governed by a
-// BSD-style license that can be found in the LICENSE file.
-
-class OperatorTest {
- static int i1, i2;
-
- OperatorTest() {}
-
- static testMain() {
- var op1 = new Operator(1);
- var op2 = new Operator(2);
- Expect.equals(3, op1 + op2);
- Expect.equals(-1, op1 - op2);
- Expect.equals(0.5, op1 / op2);
- Expect.equals(0, op1 ~/ op2);
- Expect.equals(2, op1 * op2);
- Expect.equals(1, op1 % op2);
- Expect.equals(true, !(op1 == op2));
- Expect.equals(true, op1 < op2);
- Expect.equals(true, !(op1 > op2));
- Expect.equals(true, op1 <= op2);
- Expect.equals(true, !(op1 >= op2));
- Expect.equals(3, (op1 | op2));
- Expect.equals(3, (op1 ^ op2));
- Expect.equals(0, (op1 & op2));
- Expect.equals(4, (op1 << op2));
- Expect.equals(0, (op1 >> op2));
- Expect.equals(~1, ~op1);
- Expect.equals(-1, -op1);
-
- op1.value += op2.value;
- Expect.equals(3, op1.value);
-
- op2.value += (op2.value += op2.value);
- Expect.equals(6, op2.value);
-
- op2.value -= (op2.value -= op2.value);
- Expect.equals(6, op2.value);
-
- op1.value = op2.value = 42;
- Expect.equals(42, op1.value);
- Expect.equals(42, op2.value);
-
- i1 = i2 = 42;
- Expect.equals(42, i1);
- Expect.equals(42, i2);
- i1 += 7;
- Expect.equals(49, i1);
- i1 += (i2 = 17);
- Expect.equals(66, i1);
- Expect.equals(17, i2);
-
- i1 += i2 += 3;
- Expect.equals(86, i1);
- Expect.equals(20, i2);
- }
-}
-
-class Operator {
- int value;
-
- Operator(int i) {
- value = i;
- }
-
- operator +(Operator other) {
- return value + other.value;
- }
-
- operator -(Operator other) {
- return value - other.value;
- }
-
- operator /(Operator other) {
- return value / other.value;
- }
-
- operator *(Operator other) {
- return value * other.value;
- }
-
- operator %(Operator other) {
- return value % other.value;
- }
-
- operator ==(Operator other) {
- return value == other.value;
- }
-
- operator <(Operator other) {
- return value < other.value;
- }
-
- operator >(Operator other) {
- return value > other.value;
- }
-
- operator <=(Operator other) {
- return value <= other.value;
- }
-
- operator >=(Operator other) {
- return value >= other.value;
- }
-
- operator |(Operator other) {
- return value | other.value;
- }
-
- operator ^(Operator other) {
- return value ^ other.value;
- }
-
- operator &(Operator other) {
- return value & other.value;
- }
-
- operator <<(Operator other) {
- return value << other.value;
- }
-
- operator >>(Operator other) {
- return value >> other.value;
- }
-
- operator ~/(Operator other) {
- return value ~/ other.value;
- }
-
- operator ~() {
- return ~value;
- }
-
- operator negate() {
- return -value;
- }
-}
-
-main() {
- OperatorTest.testMain();
-}
« no previous file with comments | « tests/language/src/OperatorIndexEvaluationOrderTest.dart ('k') | tests/language/src/OptimizationTest.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698