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

Unified Diff: tests/compiler/dart2js/unparser_test.dart

Issue 1388523002: dart2js: add support for configuration-specific imports. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Address comments. Created 5 years, 2 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 side-by-side diff with in-line comments
Download patch
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();

Powered by Google App Engine
This is Rietveld 408576698