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

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

Issue 12743005: Revert "Remove Expect from core library." (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Reupload (first upload failed). Created 7 years, 9 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) 2012, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2012, 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 4
5 import "package:expect/expect.dart";
6
7 topLevelMethod() => 't'; 5 topLevelMethod() => 't';
8 6
9 const topLevelFieldForTopLevelMethod = topLevelMethod; 7 const topLevelFieldForTopLevelMethod = topLevelMethod;
10 const topLevelFieldForStaticMethod = A.staticMethod; 8 const topLevelFieldForStaticMethod = A.staticMethod;
11 9
12 class A { 10 class A {
13 final Function closure; 11 final Function closure;
14 const A(this.closure); 12 const A(this.closure);
15 const A.defaultTopLevel([this.closure = topLevelMethod]); 13 const A.defaultTopLevel([this.closure = topLevelMethod]);
16 const A.defaultStatic([this.closure = staticMethod]); 14 const A.defaultStatic([this.closure = staticMethod]);
(...skipping 16 matching lines...) Expand all
33 Expect.equals('s', (new A.defaultStatic2()).run()); 31 Expect.equals('s', (new A.defaultStatic2()).run());
34 Expect.equals('t', topLevelFieldForTopLevelMethod()); 32 Expect.equals('t', topLevelFieldForTopLevelMethod());
35 Expect.equals('s', topLevelFieldForStaticMethod()); 33 Expect.equals('s', topLevelFieldForStaticMethod());
36 Expect.equals('t', A.staticFieldForTopLevelMethod()); 34 Expect.equals('t', A.staticFieldForTopLevelMethod());
37 Expect.equals('s', A.staticFieldForStaticMethod()); 35 Expect.equals('s', A.staticFieldForStaticMethod());
38 36
39 var map = const {'t': topLevelMethod, 's': A.staticMethod }; 37 var map = const {'t': topLevelMethod, 's': A.staticMethod };
40 Expect.equals('t', map['t']()); 38 Expect.equals('t', map['t']());
41 Expect.equals('s', map['s']()); 39 Expect.equals('s', map['s']());
42 } 40 }
OLDNEW
« no previous file with comments | « tests/language/methods_as_constants2_test.dart ('k') | tests/language/mint_arithmetic_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698