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

Side by Side Diff: tests/language/function_type_parameter_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) 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 4
5 import "package:expect/expect.dart";
6
7 // Test to check that we can parse closure type formal parameters with 5 // Test to check that we can parse closure type formal parameters with
8 // default value. 6 // default value.
9 7
10 class A { 8 class A {
11 final f; 9 final f;
12 A(int this.f()); 10 A(int this.f());
13 11
14 static Function func; 12 static Function func;
15 13
16 static SetFunc([String fmt(int i) = null]) { 14 static SetFunc([String fmt(int i) = null]) {
17 func = fmt; 15 func = fmt;
18 } 16 }
19 17
20 } 18 }
21 19
22 main() { 20 main() {
23 Expect.equals(null, A.func); 21 Expect.equals(null, A.func);
24 A.SetFunc((i) => "$i"); 22 A.SetFunc((i) => "$i");
25 Expect.equals(false, null == A.func); 23 Expect.equals(false, null == A.func);
26 Expect.equals("1234", A.func(1230 + 4)); 24 Expect.equals("1234", A.func(1230 + 4));
27 A.SetFunc(); 25 A.SetFunc();
28 Expect.equals(null, A.func); 26 Expect.equals(null, A.func);
29 27
30 Expect.equals(42, new A(() => 42).f()); 28 Expect.equals(42, new A(() => 42).f());
31 } 29 }
OLDNEW
« no previous file with comments | « tests/language/function_type_parameter2_test.dart ('k') | tests/language/function_type_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698