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

Unified Diff: tests/language_strong/bool_test.dart

Issue 2771453003: Format all tests. (Closed)
Patch Set: Format files Created 3 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
Index: tests/language_strong/bool_test.dart
diff --git a/tests/language_strong/bool_test.dart b/tests/language_strong/bool_test.dart
index efe8a7ae8fab9a5acf220e5f329d7907963f1ff8..51d4d9f82bc0e22ec29ef2b02355be558c7d3802 100644
--- a/tests/language_strong/bool_test.dart
+++ b/tests/language_strong/bool_test.dart
@@ -53,36 +53,28 @@ class BoolTest {
if (identical(false, true)) {
throw "Expect.equals broken";
}
- if (true == true) {
- } else {
+ if (true == true) {} else {
throw "Expect.equals broken";
}
- if (false == false) {
- } else {
+ if (false == false) {} else {
throw "Expect.equals broken";
}
- if (identical(true, true)) {
- } else {
+ if (identical(true, true)) {} else {
throw "Expect.equals broken";
}
- if (identical(false, false)) {
- } else {
+ if (identical(false, false)) {} else {
throw "Expect.equals broken";
}
- if (true != false) {
- } else {
+ if (true != false) {} else {
throw "Expect.equals broken";
}
- if (false != true) {
- } else {
+ if (false != true) {} else {
throw "Expect.equals broken";
}
- if (!identical(true, false)) {
- } else {
+ if (!identical(true, false)) {} else {
throw "Expect.equals broken";
}
- if (!identical(false, true)) {
- } else {
+ if (!identical(false, true)) {} else {
throw "Expect.equals broken";
}
if (true != true) {
@@ -119,6 +111,7 @@ class BoolTest {
return onTypeError;
}
}
+
testAnd(a, b, onTypeError) {
try {
return a && b;
@@ -147,15 +140,15 @@ class BoolTest {
Expect.equals(true, testOr(1, isTrue, true));
Expect.equals(false, testOr(0, isFalse, false));
Expect.equals(false, testOr(1, isFalse, false));
-
+
// Test side effects.
int trueCount = 0, falseCount = 0;
-
+
trueFunc() {
trueCount++;
return true;
}
-
+
falseFunc() {
falseCount++;
return false;
@@ -163,7 +156,7 @@ class BoolTest {
Expect.equals(0, trueCount);
Expect.equals(0, falseCount);
-
+
trueFunc() && trueFunc();
Expect.equals(2, trueCount);
Expect.equals(0, falseCount);
@@ -182,7 +175,7 @@ class BoolTest {
falseFunc() && falseFunc();
Expect.equals(0, trueCount);
Expect.equals(1, falseCount);
-
+
trueCount = falseCount = 0;
trueFunc() || trueFunc();
Expect.equals(1, trueCount);
@@ -203,7 +196,6 @@ class BoolTest {
Expect.equals(0, trueCount);
Expect.equals(2, falseCount);
}
-
static void testMain() {
testEquality();

Powered by Google App Engine
This is Rietveld 408576698