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

Unified Diff: test/transformer_test.dart

Issue 1018643002: change to source-order crawling of directives instead of alphabetical (Closed) Base URL: git@github.com:dart-lang/static-init.git@master
Patch Set: switch to bug fix instead of breaking change, and use definingCompilationUnit Created 5 years, 9 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
« no previous file with comments | « test/parts/foo.dart ('k') | tool/all_tests.sh » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: test/transformer_test.dart
diff --git a/test/transformer_test.dart b/test/transformer_test.dart
index e6dda995fb70096f6870148d39bfa18baa06797b..8b43d45e60904a4b4aff75df813eb5ca616ab899 100644
--- a/test/transformer_test.dart
+++ b/test/transformer_test.dart
@@ -280,6 +280,79 @@ void dartEntryPointTests() {
}
''')
}, []);
+
+ testPhases('library parts and exports', phases, {
+ 'a|web/index.dart': '''
+ @constInit
+ library index;
+
+ import 'package:test_initializers/common.dart';
+ export 'export.dart';
+
+ part 'foo.dart';
+ part 'bar.dart';
+
+ @constInit
+ index() {};
+
+ @constInit
+ class Index {};
+ ''',
+ 'a|web/foo.dart': '''
+ part of index;
+
+ @constInit
+ foo() {};
+
+ @constInit
+ class Foo {};
+ ''',
+ 'a|web/bar.dart': '''
+ part of index;
+
+ @constInit
+ bar() {};
+
+ @constInit
+ class Bar {};
+ ''',
+ 'a|web/export.dart': '''
+ @constInit
+ library export;
+
+ import 'package:test_initializers/common.dart';
+
+ @constInit
+ class Export {};
+ ''',
+ // Mock out the Initialize package plus some initializers.
+ 'initialize|lib/initialize.dart': mockInitialize,
+ 'test_initializers|lib/common.dart': commonInitializers,
+ }, {
+ 'a|web/index.initialize.dart': formatter.format('''
+ import 'package:initialize/src/static_loader.dart';
+ import 'package:initialize/initialize.dart';
+ import 'index.dart' as i0;
+ import 'export.dart' as i1;
+ import 'package:test_initializers/common.dart' as i2;
+
+ main() {
+ initializers.addAll([
+ new InitEntry(i2.constInit, const LibraryIdentifier(#export, null, 'export.dart')),
+ new InitEntry(i2.constInit, i1.Export),
+ new InitEntry(i2.constInit, const LibraryIdentifier(#index, null, 'index.dart')),
+ new InitEntry(i2.constInit, i0.bar),
+ new InitEntry(i2.constInit, i0.foo),
+ new InitEntry(i2.constInit, i0.index),
+ new InitEntry(i2.constInit, i0.Bar),
+ new InitEntry(i2.constInit, i0.Foo),
+ new InitEntry(i2.constInit, i0.Index),
+ ]);
+
+ i0.main();
+ }
+ ''')
+ }, []);
}
class SkipConstructorsPlugin extends InitializerPlugin {
« no previous file with comments | « test/parts/foo.dart ('k') | tool/all_tests.sh » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698