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

Side by Side Diff: test/initializer_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 unified diff | Download patch
« no previous file with comments | « test/initializer_parts_test.dart ('k') | test/parts/bar.dart » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2015, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2015, 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 @initializeTracker 4 @initializeTracker
5 library initialize.initializer_test; 5 library initialize.initializer_test;
6 6
7 import 'foo.dart';
8 import 'foo/bar.dart'; 7 import 'foo/bar.dart';
9 import 'package:initialize/src/initialize_tracker.dart'; 8 import 'package:initialize/src/initialize_tracker.dart';
10 import 'package:initialize/initialize.dart'; 9 import 'package:initialize/initialize.dart';
11 import 'package:test_package/foo.dart'; 10 import 'package:test_package/foo.dart';
12 import 'package:unittest/unittest.dart'; 11 import 'package:unittest/unittest.dart';
13 import 'package:unittest/compact_vm_config.dart'; 12 import 'package:unittest/compact_vm_config.dart';
14 13
15 main() { 14 main() {
16 useCompactVMConfiguration(); 15 useCompactVMConfiguration();
17 16
18 // Run all initializers. 17 // Run all initializers.
19 run().then((_) { 18 run().then((_) {
20 test('annotations are seen in post-order with superclasses first', () { 19 test('annotations are seen in post-order with superclasses first', () {
21 var expectedNames = [ 20 var expectedNames = [
22 const LibraryIdentifier(#test_package.bar, 'test_package', 'bar.dart'),
23 const LibraryIdentifier(#test_package.foo, 'test_package', 'foo.dart'),
24 const LibraryIdentifier(#initialize.test.foo, null, 'foo.dart'), 21 const LibraryIdentifier(#initialize.test.foo, null, 'foo.dart'),
22 fooBar,
25 foo, 23 foo,
26 fooBar,
27 Foo, 24 Foo,
28 const LibraryIdentifier(#initialize.test.foo.bar, null, 'foo/bar.dart'), 25 const LibraryIdentifier(#initialize.test.foo.bar, null, 'foo/bar.dart'),
29 bar, 26 bar,
30 Bar, 27 Bar,
28 const LibraryIdentifier(#test_package.bar, 'test_package', 'bar.dart'),
29 const LibraryIdentifier(#test_package.foo, 'test_package', 'foo.dart'),
31 const LibraryIdentifier( 30 const LibraryIdentifier(
32 #initialize.initializer_test, null, 'initializer_test.dart'), 31 #initialize.initializer_test, null, 'initializer_test.dart'),
33 zap, 32 zap,
34 Zoop, // Zap extends Zoop, so Zoop comes first. 33 Zoop, // Zap extends Zoop, so Zoop comes first.
35 Zap 34 Zap,
36 ]; 35 ];
37 expect(InitializeTracker.seen, expectedNames); 36 expect(InitializeTracker.seen, expectedNames);
38 }); 37 });
39 38
40 test('annotations only run once', () { 39 test('annotations only run once', () {
41 // Run the initializers again, should be a no-op. 40 // Run the initializers again, should be a no-op.
42 var originalSize = InitializeTracker.seen.length; 41 var originalSize = InitializeTracker.seen.length;
43 return run().then((_) { 42 return run().then((_) {
44 expect(InitializeTracker.seen.length, originalSize); 43 expect(InitializeTracker.seen.length, originalSize);
45 }); 44 });
46 }); 45 });
47 }); 46 });
48 } 47 }
49 48
50 @initializeTracker 49 @initializeTracker
51 class Zoop {} 50 class Zoop {}
52 51
53 @initializeTracker 52 @initializeTracker
54 class Zap extends Zoop {} 53 class Zap extends Zoop {}
55 54
56 @initializeTracker 55 @initializeTracker
57 zap() {} 56 zap() {}
OLDNEW
« no previous file with comments | « test/initializer_parts_test.dart ('k') | test/parts/bar.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698