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

Unified Diff: tests/language/call_through_null_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/call_through_getter_test.dart ('k') | tests/language/call_type_literal_test.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tests/language/call_through_null_getter_test.dart
diff --git a/tests/language/call_through_null_getter_test.dart b/tests/language/call_through_null_getter_test.dart
deleted file mode 100644
index 803f6855c96b09971e6ec483e01593775c6548ed..0000000000000000000000000000000000000000
--- a/tests/language/call_through_null_getter_test.dart
+++ /dev/null
@@ -1,90 +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.
-
-import "package:expect/expect.dart";
-
-// Tests that we can call functions through getters which return null.
-
-const TOP_LEVEL_NULL = null;
-
-var topLevel;
-
-class CallThroughNullGetterTest {
- static void testMain() {
- testTopLevel();
- testField();
- testGetter();
- testMethod();
- }
-
- static void testTopLevel() {
- topLevel = null;
- expectThrowsNoSuchMethodError(() {
- topLevel();
- });
- expectThrowsNoSuchMethodError(() {
- (topLevel)();
- });
- expectThrowsNoSuchMethodError(() {
- TOP_LEVEL_NULL();
- });
- expectThrowsNoSuchMethodError(() {
- (TOP_LEVEL_NULL)();
- });
- }
-
- static void testField() {
- A a = new A();
-
- a.field = null;
- expectThrowsNoSuchMethodError(() {
- a.field();
- });
- expectThrowsNoSuchMethodError(() {
- (a.field)();
- });
- }
-
- static void testGetter() {
- A a = new A();
-
- a.field = null;
- expectThrowsNoSuchMethodError(() {
- a.getter();
- });
- expectThrowsNoSuchMethodError(() {
- (a.getter)();
- });
- }
-
- static void testMethod() {
- A a = new A();
-
- a.field = null;
- expectThrowsNoSuchMethodError(() {
- a.method()();
- });
- }
-
- static void expectThrowsNoSuchMethodError(fn) {
- Expect.throws(
- fn, (e) => e is NoSuchMethodError, "Should throw NoSuchMethodError");
- }
-}
-
-class A {
- A() {}
- var field;
- get getter {
- return field;
- }
-
- method() {
- return field;
- }
-}
-
-main() {
- CallThroughNullGetterTest.testMain();
-}
« no previous file with comments | « tests/language/call_through_getter_test.dart ('k') | tests/language/call_type_literal_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698