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

Side by Side Diff: tests/language/src/SuperImplicitClosureTest.dart

Issue 10248007: test rename overhaul: step 8 - language tests (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 8 years, 7 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
(Empty)
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
3 // BSD-style license that can be found in the LICENSE file.
4 // Dart test program for testing invocation of implicit closures.
5
6 class BaseClass {
7 BaseClass(this._i) {}
8 int foo() { return _i; }
9 int _i;
10 }
11
12 class DerivedClass extends BaseClass {
13 DerivedClass(this._y, int j) : super(j) {}
14 int foo() { return _y; }
15 getSuper() { return super.foo; }
16 int _y;
17 }
18
19 class SuperImplicitClosureTest {
20 static void testMain() {
21 DerivedClass obj = new DerivedClass(20, 10);
22
23 var ib = obj.foo;
24 Expect.equals(obj._y, ib());
25
26 ib = obj.getSuper();
27 Expect.equals(obj._i, ib());
28 }
29 }
30
31
32 main() {
33 SuperImplicitClosureTest.testMain();
34 }
OLDNEW
« no previous file with comments | « tests/language/src/SuperFirstConstructorTest.dart ('k') | tests/language/src/SuperOperatorTest.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698