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

Side by Side Diff: tests/language/src/GenericInstanceof3Test.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 // Dart test program for testing the instanceof operation.
5
6 // Tests involving generics.
7
8 interface I<T> {
9 }
10
11
12 class A implements I<bool> {
13 }
14
15
16 class B<T> implements I<bool> {
17 }
18
19
20 interface K<T> {
21
22 }
23
24 interface L<T> extends K<bool> {
25
26 }
27
28
29 class C implements L<String> {
30
31 }
32
33
34 class D implements B<String> {
35
36 }
37
38
39
40 main() {
41 var a = new A();
42 var b = new B<String>();
43 var c = new C();
44 var d = new D();
45 // Repeat type checks so that inlined tests can be tested as well.
46 for (int i = 0; i < 5; i++) {
47 Expect.isFalse(a is I<String>);
48 Expect.isTrue(a is I<bool>);
49 Expect.isFalse(b is I<String>);
50 Expect.isFalse(c is K<String>);
51 Expect.isFalse(c is K<String>);
52 Expect.isTrue(c is L<String>);
53 Expect.isFalse(c is L<bool>);
54 Expect.isTrue(c is K<bool>);
55 Expect.isFalse(c is K<String>);
56 Expect.isFalse(d is I<String>);
57 Expect.isTrue(d is I<bool>);
58 }
59 }
OLDNEW
« no previous file with comments | « tests/language/src/GenericInstanceof2Test.dart ('k') | tests/language/src/GenericInstanceofTest.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698