Index: tests/compiler/dart2js/unparser_test.dart |
diff --git a/tests/compiler/dart2js/unparser_test.dart b/tests/compiler/dart2js/unparser_test.dart |
index 4b9a8153526ab75e44b94a19714829d0a817cd71..e19ed0ddae6e8361df1fcde5a14de4efa45e6f8f 100644 |
--- a/tests/compiler/dart2js/unparser_test.dart |
+++ b/tests/compiler/dart2js/unparser_test.dart |
@@ -98,6 +98,57 @@ testExport() { |
testUnparseTopLevelWithMetadata('export "søhest";'); |
} |
+testConditionalImport() { |
+ testUnparseTopLevelWithMetadata( |
+ 'import "søhest" if(some.dotted.id)"other";'); |
+ testUnparseTopLevelWithMetadata( |
+ 'import "søhest" if(id=="some str")"other";'); |
+ testUnparseTopLevelWithMetadata( |
+ 'import "søhest"' |
+ ' if(id=="some str")"other"' |
+ ' if(id)"other2";'); |
+ testUnparseTopLevelWithMetadata( |
+ 'import "søhest" if(some.dotted.id)"other" as fiskehest;'); |
+ testUnparseTopLevelWithMetadata( |
+ 'import "søhest" if(id=="some str")"other" as fiskehest;'); |
+ testUnparseTopLevelWithMetadata( |
+ 'import "søhest"' |
+ ' if(id=="some str")"other"' |
+ ' if(id)"other2"' |
+ ' as fiskehest;'); |
+ testUnparseTopLevelWithMetadata( |
+ 'import "søhest" if(some.dotted.id)"other" deferred as fiskehest;'); |
+ testUnparseTopLevelWithMetadata( |
+ 'import "søhest" if(id=="some str")"other" deferred as fiskehest;'); |
+ testUnparseTopLevelWithMetadata( |
+ 'import "søhest"' |
+ ' if(id=="some str")"other"' |
+ ' if(id)"other2"' |
+ ' deferred as fiskehest;'); |
+ testUnparseTopLevelWithMetadata( |
+ 'import "søhest"' |
+ ' if(id=="some str")"other"' |
+ ' if(id)"other2"' |
+ ' deferred as fiskehest' |
+ ' show foo,bar;'); |
+} |
+ |
+testConditionalExport() { |
+ testUnparseTopLevelWithMetadata( |
+ 'export "søhest" if(some.dotted.id)"other";'); |
+ testUnparseTopLevelWithMetadata( |
+ 'export "søhest" if(id=="some str")"other";'); |
+ testUnparseTopLevelWithMetadata( |
+ 'export "søhest"' |
+ ' if(id=="some str")"other"' |
+ ' if(id)"other2";'); |
+ testUnparseTopLevelWithMetadata( |
+ 'export "søhest"' |
+ ' if(id=="some str")"other"' |
+ ' if(id)"other2"' |
+ ' show foo,bar;'); |
+} |
+ |
testPart() { |
testUnparseTopLevelWithMetadata('part "søhest";'); |
} |
@@ -383,6 +434,8 @@ main() { |
testLibraryName(); |
testImport(); |
testExport(); |
+ testConditionalImport(); |
+ testConditionalExport(); |
testPart(); |
testPartOf(); |
testCombinators(); |