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

Unified Diff: tests/language_2/call_through_getter_test.dart

Issue 2998493002: Migrate language block 45 - call_argument ... call_with. (Closed)
Patch Set: Merge branch 'master' into migrate-45 Created 3 years, 4 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_2/call_this_test.dart ('k') | tests/language_2/call_through_null_getter_test.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tests/language_2/call_through_getter_test.dart
diff --git a/tests/language_strong/call_through_getter_test.dart b/tests/language_2/call_through_getter_test.dart
similarity index 79%
rename from tests/language_strong/call_through_getter_test.dart
rename to tests/language_2/call_through_getter_test.dart
index e7eac4a4ed838ca1e168be6d883bcd87007fccb0..f489be41d93125f2fbd90eec402c1a316aedb4ab 100644
--- a/tests/language_strong/call_through_getter_test.dart
+++ b/tests/language_2/call_through_getter_test.dart
@@ -29,12 +29,8 @@ class CallThroughGetterTest {
Expect.equals(1, TOP_LEVEL_CONST_REF);
Expect.equals(2, topLevel());
- expectThrowsNoSuchMethod(() {
- TOP_LEVEL_CONST(); //# static type warning
- });
- expectThrowsNoSuchMethod(() {
- (TOP_LEVEL_CONST)(); // //# static type warning
- });
+ TOP_LEVEL_CONST(); //# 01: compile-time error
+ (TOP_LEVEL_CONST)(); //# 02: compile-time error
}
static void testField() {
@@ -48,10 +44,10 @@ class CallThroughGetterTest {
Expect.equals(87, (a.field)());
a.field = 99;
- expectThrowsNoSuchMethod(() {
+ Expect.throwsNoSuchMethodError(() {
a.field();
});
- expectThrowsNoSuchMethod(() {
+ Expect.throwsNoSuchMethodError(() {
(a.field)();
});
}
@@ -67,10 +63,10 @@ class CallThroughGetterTest {
Expect.equals(87, (a.getter)());
a.field = 99;
- expectThrowsNoSuchMethod(() {
+ Expect.throwsNoSuchMethodError(() {
a.getter();
});
- expectThrowsNoSuchMethod(() {
+ Expect.throwsNoSuchMethodError(() {
(a.getter)();
});
}
@@ -115,28 +111,6 @@ class CallThroughGetterTest {
b = new B();
Expect.equals("gyzxf", (b.g3)(b.y, b.z, b.x));
}
-
- static expectThrowsNoSuchMethod(fn) {
- var exception = catchException(fn);
- if (exception is! NoSuchMethodError) {
- Expect.fail("Wrong exception. Expected: NoSuchMethodError"
- " got: ${exception}");
- }
- }
-
- static catchException(fn) {
- bool caught = false;
- var result = null;
- try {
- fn();
- Expect.equals(true, false); // Shouldn't reach this.
- } catch (e) {
- caught = true;
- result = e;
- }
- Expect.equals(true, caught);
- return result;
- }
}
class A {
« no previous file with comments | « tests/language_2/call_this_test.dart ('k') | tests/language_2/call_through_null_getter_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698