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 'package:expect/expect.dart'; | 5 import 'package:expect/expect.dart'; |
6 import 'parser_helper.dart'; | 6 import 'parser_helper.dart'; |
7 import 'package:compiler/src/tree/tree.dart'; | 7 import 'package:compiler/src/tree/tree.dart'; |
8 | 8 |
9 testUnparse(String statement) { | 9 testUnparse(String statement) { |
10 Node node = parseStatement(statement); | 10 Node node = parseStatement(statement); |
(...skipping 80 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
91 | 91 |
92 testImport() { | 92 testImport() { |
93 testUnparseTopLevelWithMetadata('import "søhest";'); | 93 testUnparseTopLevelWithMetadata('import "søhest";'); |
94 testUnparseTopLevelWithMetadata('import "søhest" as fiskehest;'); | 94 testUnparseTopLevelWithMetadata('import "søhest" as fiskehest;'); |
95 } | 95 } |
96 | 96 |
97 testExport() { | 97 testExport() { |
98 testUnparseTopLevelWithMetadata('export "søhest";'); | 98 testUnparseTopLevelWithMetadata('export "søhest";'); |
99 } | 99 } |
100 | 100 |
101 testConditionalImport() { | |
102 testUnparseTopLevelWithMetadata( | |
103 'import "søhest" if(some.dotted.id)"other";'); | |
104 testUnparseTopLevelWithMetadata( | |
105 'import "søhest" if(id=="some str")"other";'); | |
106 testUnparseTopLevelWithMetadata( | |
107 'import "søhest"' | |
108 ' if(id=="some str")"other"' | |
109 ' if(id)"other2";'); | |
110 testUnparseTopLevelWithMetadata( | |
111 'import "søhest" if(some.dotted.id)"other" as fiskehest;'); | |
112 testUnparseTopLevelWithMetadata( | |
113 'import "søhest" if(id=="some str")"other" as fiskehest;'); | |
114 testUnparseTopLevelWithMetadata( | |
115 'import "søhest"' | |
116 ' if(id=="some str")"other"' | |
117 ' if(id)"other2"' | |
118 ' as fiskehest;'); | |
119 testUnparseTopLevelWithMetadata( | |
120 'import "søhest" if(some.dotted.id)"other" deferred as fiskehest;'); | |
121 testUnparseTopLevelWithMetadata( | |
122 'import "søhest" if(id=="some str")"other" deferred as fiskehest;'); | |
123 testUnparseTopLevelWithMetadata( | |
124 'import "søhest"' | |
125 ' if(id=="some str")"other"' | |
126 ' if(id)"other2"' | |
127 ' deferred as fiskehest;'); | |
128 testUnparseTopLevelWithMetadata( | |
129 'import "søhest"' | |
130 ' if(id=="some str")"other"' | |
131 ' if(id)"other2"' | |
132 ' deferred as fiskehest' | |
133 ' show foo,bar;'); | |
134 } | |
135 | |
136 testConditionalExport() { | |
137 testUnparseTopLevelWithMetadata( | |
138 'export "søhest" if(some.dotted.id)"other";'); | |
139 testUnparseTopLevelWithMetadata( | |
140 'export "søhest" if(id=="some str")"other";'); | |
141 testUnparseTopLevelWithMetadata( | |
142 'export "søhest"' | |
143 ' if(id=="some str")"other"' | |
144 ' if(id)"other2";'); | |
145 testUnparseTopLevelWithMetadata( | |
146 'export "søhest"' | |
147 ' if(id=="some str")"other"' | |
148 ' if(id)"other2"' | |
149 ' show foo,bar;'); | |
150 } | |
151 | |
152 testPart() { | 101 testPart() { |
153 testUnparseTopLevelWithMetadata('part "søhest";'); | 102 testUnparseTopLevelWithMetadata('part "søhest";'); |
154 } | 103 } |
155 | 104 |
156 testPartOf() { | 105 testPartOf() { |
157 testUnparseTopLevelWithMetadata('part of com;'); | 106 testUnparseTopLevelWithMetadata('part of com;'); |
158 testUnparseTopLevelWithMetadata('part of com.example;'); | 107 testUnparseTopLevelWithMetadata('part of com.example;'); |
159 testUnparseTopLevelWithMetadata('part of com.example.dart;'); | 108 testUnparseTopLevelWithMetadata('part of com.example.dart;'); |
160 } | 109 } |
161 | 110 |
(...skipping 265 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
427 testEmptyList(); | 376 testEmptyList(); |
428 testClosure(); | 377 testClosure(); |
429 testIndexedOperatorDecl(); | 378 testIndexedOperatorDecl(); |
430 testNativeMethods(); | 379 testNativeMethods(); |
431 testPrefixIncrements(); | 380 testPrefixIncrements(); |
432 testConstModifier(); | 381 testConstModifier(); |
433 testSimpleObjectInstantiation(); | 382 testSimpleObjectInstantiation(); |
434 testLibraryName(); | 383 testLibraryName(); |
435 testImport(); | 384 testImport(); |
436 testExport(); | 385 testExport(); |
437 testConditionalImport(); | |
438 testConditionalExport(); | |
439 testPart(); | 386 testPart(); |
440 testPartOf(); | 387 testPartOf(); |
441 testCombinators(); | 388 testCombinators(); |
442 testDeferredImport(); | 389 testDeferredImport(); |
443 testRedirectingFactoryConstructors(); | 390 testRedirectingFactoryConstructors(); |
444 testClassDeclarations(); | 391 testClassDeclarations(); |
445 testMixinApplications(); | 392 testMixinApplications(); |
446 testParameters(); | 393 testParameters(); |
447 testSymbolLiterals(); | 394 testSymbolLiterals(); |
448 } | 395 } |
OLD | NEW |