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

Side by Side Diff: tests/language/src/GenericSyntaxTest.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) 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
3 // BSD-style license that can be found in the LICENSE file.
4
5 // Dart test verifying that the parser does not confuse parameterized types with
6 // boolean expressions, since both contain '<'.
7
8 class GenericSyntaxTest<B, C, D, E, F> {
9 GenericSyntaxTest() {}
10
11 void foo(x1, x2, x3, x4, x5) {
12 Expect.equals(true, x1);
13 Expect.equals(3, x2);
14 Expect.equals(4, x3);
15 Expect.equals(5, x4);
16 Expect.equals(false, x5);
17 }
18
19 void bar(x) {
20 Expect.equals(null, x());
21 }
22
23 test() {
24 var a = 1;
25 var b = 2;
26 var c = 3;
27 var d = 4;
28 var e = 5;
29 var f = 6;
30 var g = 7;
31 var h = null;
32 bar(A<B, C, D, E, F> g() { return h; }); // 'A<B' starts a generic type.
33 foo(a<b, c, d, e, f> g); // 'a<b' is a boolean function argument.
34 }
35
36 static testMain() {
37 new GenericSyntaxTest().test();
38 }
39 }
40
41 interface A<B, C, D, E, F> {
42 }
43
44 main() {
45 GenericSyntaxTest.testMain();
46 }
OLDNEW
« no previous file with comments | « tests/language/src/GenericParameterizedExtendsTest.dart ('k') | tests/language/src/GenericTest.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698