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

Unified Diff: tests/standalone/assert_test.dart

Issue 10915083: Change assert implementation to not depend on a top-level function called 'assert'. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Address review comments. Created 8 years, 3 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/language_dart2js.status ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tests/standalone/assert_test.dart
diff --git a/tests/standalone/assert_test.dart b/tests/standalone/assert_test.dart
index 8e1b288e5b28002e95553e6903e37097bdde2c11..ae841bdcc2b596b365f78095e9b63eaca33d0864 100644
--- a/tests/standalone/assert_test.dart
+++ b/tests/standalone/assert_test.dart
@@ -7,11 +7,10 @@
class AssertTest {
static test() {
- int i = 0;
try {
assert(false);
+ Expect.fail("Assertion 'false' didn't fail.");
} on AssertionError catch (error) {
- i = 1;
Expect.equals("false", error.failedAssertion);
int pos = error.url.lastIndexOf("/", error.url.length);
if (pos == -1) {
@@ -19,17 +18,15 @@ class AssertTest {
}
String subs = error.url.substring(pos + 1, error.url.length);
Expect.equals("assert_test.dart", subs);
- Expect.equals(12, error.line);
+ Expect.equals(11, error.line);
Expect.equals(14, error.column);
}
- return i;
}
static testClosure() {
- int i = 0;
try {
assert(() => false);
+ Expect.fail("Assertion '() => false' didn't fail.");
} on AssertionError catch (error) {
- i = 1;
Expect.equals("() => false", error.failedAssertion);
int pos = error.url.lastIndexOf("/", error.url.length);
if (pos == -1) {
@@ -37,15 +34,14 @@ class AssertTest {
}
String subs = error.url.substring(pos + 1, error.url.length);
Expect.equals("assert_test.dart", subs);
- Expect.equals(30, error.line);
+ Expect.equals(27, error.line);
Expect.equals(14, error.column);
}
- return i;
}
static testMain() {
- Expect.equals(1, test());
- Expect.equals(1, testClosure());
+ test();
+ testClosure();
}
}
« no previous file with comments | « tests/language/language_dart2js.status ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698