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

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: format 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
« lib/transformer.dart ('K') | « test/initializer_test.dart ('k') | no next file » | 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..da91253d3a85cfbb49c19aea0a29c0e846dfa76b 100644
--- a/test/transformer_test.dart
+++ b/test/transformer_test.dart
@@ -280,6 +280,59 @@ 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';
+ ''',
+ 'a|web/foo.dart': '''
+ part of index;
+
+ @constInit
+ foo() {};
+ ''',
+ 'a|web/bar.dart': '''
+ part of index;
+
+ @constInit
+ bar() {};
+ ''',
+ 'a|web/export.dart': '''
+ @constInit
+ library export;
+
+ import 'package:test_initializers/common.dart';
+ ''',
+ // 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, const LibraryIdentifier(#index, null, 'index.dart')),
+ new InitEntry(i2.constInit, i0.foo),
+ new InitEntry(i2.constInit, i0.bar),
+ ]);
+
+ i0.main();
+ }
+ ''')
+ }, []);
}
class SkipConstructorsPlugin extends InitializerPlugin {
« lib/transformer.dart ('K') | « test/initializer_test.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698