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

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

Issue 2771453003: Format all tests. (Closed)
Patch Set: Format files Created 3 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
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 // Dart test for function type alias with a type parameter as result type. 5 // Dart test for function type alias with a type parameter as result type.
6 6
7 import "package:expect/expect.dart"; 7 import "package:expect/expect.dart";
8 8
9 typedef bool F<bool>(bool a); // 'bool' is not the boolean type. 9 typedef bool F<bool>(bool a); // 'bool' is not the boolean type.
10 10
11 bool bar(bool a) { 11 bool bar(bool a) {}
12 }
13 12
14 int baz(int a) { 13 int baz(int a) {}
15 }
16 14
17 class A<T> { 15 class A<T> {
18 T foo(T a) { 16 T foo(T a) {}
19 }
20 } 17 }
21 18
22 main() { 19 main() {
23 Expect.isTrue(bar is F); 20 Expect.isTrue(bar is F);
24 Expect.isTrue(baz is F); 21 Expect.isTrue(baz is F);
25 Expect.isTrue(bar is F<bool>); 22 Expect.isTrue(bar is F<bool>);
26 Expect.isTrue(baz is F<int>); 23 Expect.isTrue(baz is F<int>);
27 Expect.isTrue(bar is !F<int>); 24 Expect.isTrue(bar is! F<int>);
28 Expect.isTrue(baz is !F<bool>); 25 Expect.isTrue(baz is! F<bool>);
29 26
30 var b = new A<bool>(); 27 var b = new A<bool>();
31 var i = new A<int>(); 28 var i = new A<int>();
32 Expect.isTrue(b.foo is F); 29 Expect.isTrue(b.foo is F);
33 Expect.isTrue(i.foo is F); 30 Expect.isTrue(i.foo is F);
34 Expect.isTrue(b.foo is F<bool>); 31 Expect.isTrue(b.foo is F<bool>);
35 Expect.isTrue(i.foo is F<int>); 32 Expect.isTrue(i.foo is F<int>);
36 Expect.isTrue(b.foo is !F<int>); 33 Expect.isTrue(b.foo is! F<int>);
37 Expect.isTrue(i.foo is !F<bool>); 34 Expect.isTrue(i.foo is! F<bool>);
38 } 35 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698