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

Side by Side Diff: tests/language/super_implicit_closure_test.dart

Issue 12212016: Remove Expect from core library. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Add deprecation comment for ExpectException and revert one test. Created 7 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a 2 // for details. All rights reserved. Use of this source code is governed by a
3 // BSD-style license that can be found in the LICENSE file. 3 // BSD-style license that can be found in the LICENSE file.
4 // Dart test program for testing invocation of implicit closures. 4 // Dart test program for testing invocation of implicit closures.
5 5
6 import "package:expect/expect.dart";
7
6 class BaseClass { 8 class BaseClass {
7 BaseClass(this._i) {} 9 BaseClass(this._i) {}
8 int foo() { return _i; } 10 int foo() { return _i; }
9 int _i; 11 int _i;
10 } 12 }
11 13
12 class DerivedClass extends BaseClass { 14 class DerivedClass extends BaseClass {
13 DerivedClass(this._y, int j) : super(j) {} 15 DerivedClass(this._y, int j) : super(j) {}
14 int foo() { return _y; } 16 int foo() { return _y; }
15 getSuper() { return super.foo; } 17 getSuper() { return super.foo; }
16 int _y; 18 int _y;
17 } 19 }
18 20
19 class SuperImplicitClosureTest { 21 class SuperImplicitClosureTest {
20 static void testMain() { 22 static void testMain() {
21 DerivedClass obj = new DerivedClass(20, 10); 23 DerivedClass obj = new DerivedClass(20, 10);
22 24
23 var ib = obj.foo; 25 var ib = obj.foo;
24 Expect.equals(obj._y, ib()); 26 Expect.equals(obj._y, ib());
25 27
26 ib = obj.getSuper(); 28 ib = obj.getSuper();
27 Expect.equals(obj._i, ib()); 29 Expect.equals(obj._i, ib());
28 } 30 }
29 } 31 }
30 32
31 33
32 main() { 34 main() {
33 SuperImplicitClosureTest.testMain(); 35 SuperImplicitClosureTest.testMain();
34 } 36 }
OLDNEW
« no previous file with comments | « tests/language/super_first_constructor_test.dart ('k') | tests/language/super_operator_index2_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698