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

Side by Side Diff: tests/language/src/IsFunctionTest.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) 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
3 // BSD-style license that can be found in the LICENSE file.
4
5 var staticClosure;
6 staticMethod() => 42;
7
8 class B {
9 var instanceClosure;
10 var nullField;
11 instanceMethod() => 43;
12 }
13
14 checkUntyped(closure) {
15 Expect.isTrue(closure is Function);
16 }
17
18 checkTyped(int closure()) {
19 Expect.isTrue(closure is Function);
20 }
21
22 checkTypedNull(int closure()) {
23 Expect.isFalse(closure is Function);
24 }
25
26 checkUntypedNull(closure) {
27 Expect.isFalse(closure is Function);
28 }
29
30 main() {
31 staticClosure = () => 44;
32 B b = new B();
33 b.instanceClosure = () => 45;
34
35 closureStatement() => 46;
36 var closureExpression = () => 47;
37
38 checkUntyped(staticClosure);
39 checkTyped(staticClosure);
40
41 checkUntyped(staticMethod);
42 checkTyped(staticMethod);
43
44 checkUntyped(b.instanceClosure);
45 checkTyped(b.instanceClosure);
46
47 checkUntyped(b.instanceMethod);
48 checkTyped(b.instanceMethod);
49
50 checkUntyped(closureStatement);
51 checkTyped(closureStatement);
52
53 checkUntyped(closureExpression);
54 checkTyped(closureExpression);
55
56 checkTypedNull(b.nullField);
57 checkUntypedNull(b.nullField);
58 }
OLDNEW
« no previous file with comments | « tests/language/src/IntrinsifiedMethodsTest.dart ('k') | tests/language/src/IsNotClass1NegativeTest.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698