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

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

Issue 11361190: a === b -> identical(a, b) (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Address comments. Created 8 years, 1 month 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
« no previous file with comments | « tests/language/function_syntax_test.dart ('k') | tests/language/if_and_test.dart » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 // VMOptions=--enable_type_checks 4 // VMOptions=--enable_type_checks
5 // 5 //
6 // Dart test for function type alias. 6 // Dart test for function type alias.
7 7
8 typedef Fun(a, b); 8 typedef Fun(a, b);
9 9
10 typedef int IntFun(a, b); 10 typedef int IntFun(a, b);
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after
61 int compareStrLenReverse(String a, String b, [bool reverse = false]) { 61 int compareStrLenReverse(String a, String b, [bool reverse = false]) {
62 return reverse ? (a.length - b.length) : (b.length - a.length); 62 return reverse ? (a.length - b.length) : (b.length - a.length);
63 } 63 }
64 Expect.isTrue(compareStrLenReverse is Fun); 64 Expect.isTrue(compareStrLenReverse is Fun);
65 Expect.isTrue(compareStrLenReverse is IntFun); 65 Expect.isTrue(compareStrLenReverse is IntFun);
66 Expect.isTrue(compareStrLenReverse is !BoolFun); 66 Expect.isTrue(compareStrLenReverse is !BoolFun);
67 Expect.isTrue(compareStrLenReverse is CompareObj); 67 Expect.isTrue(compareStrLenReverse is CompareObj);
68 Expect.isTrue(compareStrLenReverse is !CompareInt); 68 Expect.isTrue(compareStrLenReverse is !CompareInt);
69 Expect.isTrue(compareStrLenReverse is CompareString); 69 Expect.isTrue(compareStrLenReverse is CompareString);
70 70
71 int compareObj(Object a, Object b) { return a === b ? 0 : -1; } 71 int compareObj(Object a, Object b) { return identical(a, b) ? 0 : -1; }
72 Expect.isTrue(compareObj is Fun); 72 Expect.isTrue(compareObj is Fun);
73 Expect.isTrue(compareObj is IntFun); 73 Expect.isTrue(compareObj is IntFun);
74 Expect.isTrue(compareObj is !BoolFun); 74 Expect.isTrue(compareObj is !BoolFun);
75 Expect.isTrue(compareObj is CompareObj); 75 Expect.isTrue(compareObj is CompareObj);
76 Expect.isTrue(compareObj is CompareInt); 76 Expect.isTrue(compareObj is CompareInt);
77 Expect.isTrue(compareObj is !CompareString); 77 Expect.isTrue(compareObj is !CompareString);
78 Expect.equals(-1, test(compareObj, "abcdef", "xyz")); 78 Expect.equals(-1, test(compareObj, "abcdef", "xyz"));
79 79
80 CompareInt minus = int _(int a, int b) { return a - b; }; 80 CompareInt minus = int _(int a, int b) { return a - b; };
81 Expect.isTrue(minus is Fun); 81 Expect.isTrue(minus is Fun);
(...skipping 17 matching lines...) Expand all
99 Function boundsTrue = void _(int arg) { }; 99 Function boundsTrue = void _(int arg) { };
100 Function boundsFalse = void _(String arg) { }; 100 Function boundsFalse = void _(String arg) { };
101 Expect.isTrue(boundsTrue is BoundsCheck<num>); 101 Expect.isTrue(boundsTrue is BoundsCheck<num>);
102 Expect.isFalse(boundsFalse is BoundsCheck<num>); 102 Expect.isFalse(boundsFalse is BoundsCheck<num>);
103 } 103 }
104 } 104 }
105 105
106 main() { 106 main() {
107 FunctionTypeAliasTest.testMain(); 107 FunctionTypeAliasTest.testMain();
108 } 108 }
OLDNEW
« no previous file with comments | « tests/language/function_syntax_test.dart ('k') | tests/language/if_and_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698