| OLD | NEW |
| 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file | 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 | 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 #import('dart:uri'); | 5 #import('dart:uri'); |
| 6 #import('parser_helper.dart'); | 6 #import('parser_helper.dart'); |
| 7 #import("../../../lib/compiler/compiler.dart"); | 7 #import("../../../lib/compiler/compiler.dart"); |
| 8 #import("../../../lib/compiler/implementation/tree/tree.dart"); | 8 #import("../../../lib/compiler/implementation/tree/tree.dart"); |
| 9 | 9 |
| 10 testUnparse(String statement) { | 10 testUnparse(String statement) { |
| (...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 92 } | 92 } |
| 93 | 93 |
| 94 testGenericTypes() { | 94 testGenericTypes() { |
| 95 testUnparse('var x=new List<List<int>>();'); | 95 testUnparse('var x=new List<List<int>>();'); |
| 96 testUnparse('var x=new List<List<List<int>>>();'); | 96 testUnparse('var x=new List<List<List<int>>>();'); |
| 97 testUnparse('var x=new List<List<List<List<int>>>>();'); | 97 testUnparse('var x=new List<List<List<List<int>>>>();'); |
| 98 testUnparse('var x=new List<List<List<List<List<int>>>>>();'); | 98 testUnparse('var x=new List<List<List<List<List<int>>>>>();'); |
| 99 } | 99 } |
| 100 | 100 |
| 101 testForLoop() { | 101 testForLoop() { |
| 102 testUnparse('for(;i<100;i++){}'); | 102 testUnparse('for(;i<100;i++ ){}'); |
| 103 testUnparse('for(i=0;i<100;i++){}'); | 103 testUnparse('for(i=0;i<100;i++ ){}'); |
| 104 } | 104 } |
| 105 | 105 |
| 106 testEmptyList() { | 106 testEmptyList() { |
| 107 testUnparse('var x=[];'); | 107 testUnparse('var x=[];'); |
| 108 } | 108 } |
| 109 | 109 |
| 110 testClosure() { | 110 testClosure() { |
| 111 testUnparse('var x=(var x)=> x;'); | 111 testUnparse('var x=(var x)=> x;'); |
| 112 } | 112 } |
| 113 | 113 |
| 114 testIndexedOperatorDecl() { | 114 testIndexedOperatorDecl() { |
| 115 testUnparseMember('operator[](int i)=> null;'); | 115 testUnparseMember('operator[](int i)=> null;'); |
| 116 testUnparseMember('operator[]=(int i,int j)=> null;'); | 116 testUnparseMember('operator[]=(int i,int j)=> null;'); |
| 117 } | 117 } |
| 118 | 118 |
| 119 testNativeMethods() { | 119 testNativeMethods() { |
| 120 testUnparseMember('foo()native;'); | 120 testUnparseMember('foo()native;'); |
| 121 testUnparseMember('foo()native "bar";'); | 121 testUnparseMember('foo()native "bar";'); |
| 122 testUnparseMember('foo()native "this.x = 41";'); | 122 testUnparseMember('foo()native "this.x = 41";'); |
| 123 } | 123 } |
| 124 | 124 |
| 125 testPrefixIncrements() { | 125 testPrefixIncrements() { |
| 126 testUnparse('++i;'); | 126 testUnparse(' ++i;'); |
| 127 testUnparse('++a[i];'); | 127 testUnparse('++a[i];'); |
| 128 testUnparse('++a[++b[i]];'); | 128 testUnparse('++a[++b[i]];'); |
| 129 } | 129 } |
| 130 | 130 |
| 131 testConstModifier() { | 131 testConstModifier() { |
| 132 testUnparse('foo([var a=const []]){}'); | 132 testUnparse('foo([var a=const []]){}'); |
| 133 testUnparse('foo([var a=const{}]){}'); | 133 testUnparse('foo([var a=const{}]){}'); |
| 134 testUnparse('foo(){var a=const []; var b=const{};}'); | 134 testUnparse('foo(){var a=const []; var b=const{};}'); |
| 135 testUnparse('foo([var a=const [const{"a": const [1,2,3]}]]){}'); | 135 testUnparse('foo([var a=const [const{"a": const [1,2,3]}]]){}'); |
| 136 } | 136 } |
| (...skipping 282 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 419 testGetSet(); | 419 testGetSet(); |
| 420 testFactoryConstructor(); | 420 testFactoryConstructor(); |
| 421 testAbstractClass(); | 421 testAbstractClass(); |
| 422 testConflictSendsRename(); | 422 testConflictSendsRename(); |
| 423 testNoConflictSendsRename(); | 423 testNoConflictSendsRename(); |
| 424 testConflictLibraryClassRename(); | 424 testConflictLibraryClassRename(); |
| 425 testDefaultClassWithArgs(); | 425 testDefaultClassWithArgs(); |
| 426 testClassExtendsWithArgs(); | 426 testClassExtendsWithArgs(); |
| 427 testStaticInvocation(); | 427 testStaticInvocation(); |
| 428 } | 428 } |
| OLD | NEW |