| OLD | NEW |
| 1 // Copyright (c) 2017, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2017, 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 | 4 |
| 5 import 'dart:async'; | 5 import 'dart:async'; |
| 6 | 6 |
| 7 import 'package:front_end/memory_file_system.dart'; | 7 import 'package:front_end/memory_file_system.dart'; |
| 8 import 'package:front_end/src/fasta/uri_translator_impl.dart'; | 8 import 'package:front_end/src/fasta/uri_translator_impl.dart'; |
| 9 import 'package:front_end/src/byte_store/byte_store.dart'; | 9 import 'package:front_end/src/byte_store/byte_store.dart'; |
| 10 import 'package:front_end/src/incremental/file_state.dart'; | 10 import 'package:front_end/src/incremental/file_state.dart'; |
| (...skipping 398 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 409 FileState d = await fsState.getFile(dUri); | 409 FileState d = await fsState.getFile(dUri); |
| 410 | 410 |
| 411 List<LibraryCycle> cycles = d.topologicalOrder; | 411 List<LibraryCycle> cycles = d.topologicalOrder; |
| 412 expect(cycles, hasLength(4)); | 412 expect(cycles, hasLength(4)); |
| 413 | 413 |
| 414 expect(cycles[0].libraries, contains(core)); | 414 expect(cycles[0].libraries, contains(core)); |
| 415 expect(cycles[1].libraries, unorderedEquals([a])); | 415 expect(cycles[1].libraries, unorderedEquals([a])); |
| 416 expect(cycles[2].libraries, unorderedEquals([b, c])); | 416 expect(cycles[2].libraries, unorderedEquals([b, c])); |
| 417 expect(cycles[3].libraries, unorderedEquals([d])); | 417 expect(cycles[3].libraries, unorderedEquals([d])); |
| 418 | 418 |
| 419 expect(cycles[0].directDependencies, isEmpty); |
| 420 expect(cycles[1].directDependencies, unorderedEquals([cycles[0]])); |
| 421 expect(cycles[2].directDependencies, unorderedEquals([cycles[0]])); |
| 422 expect(cycles[3].directDependencies, |
| 423 unorderedEquals([cycles[0], cycles[1], cycles[2]])); |
| 424 |
| 419 expect(cycles[0].directUsers, | 425 expect(cycles[0].directUsers, |
| 420 unorderedEquals([cycles[1], cycles[2], cycles[3]])); | 426 unorderedEquals([cycles[1], cycles[2], cycles[3]])); |
| 421 expect(cycles[1].directUsers, unorderedEquals([cycles[3]])); | 427 expect(cycles[1].directUsers, unorderedEquals([cycles[3]])); |
| 422 expect(cycles[2].directUsers, unorderedEquals([cycles[3]])); | 428 expect(cycles[2].directUsers, unorderedEquals([cycles[3]])); |
| 423 expect(cycles[3].directUsers, isEmpty); | 429 expect(cycles[3].directUsers, isEmpty); |
| 424 } | 430 } |
| 425 | 431 |
| 426 test_topologicalOrder_cycleBeforeTarget_export() async { | 432 test_topologicalOrder_cycleBeforeTarget_export() async { |
| 427 var aUri = _writeFileDirectives('/a.dart'); | 433 var aUri = _writeFileDirectives('/a.dart'); |
| 428 var bUri = _writeFileDirectives('/b.dart', exports: ['c.dart']); | 434 var bUri = _writeFileDirectives('/b.dart', exports: ['c.dart']); |
| (...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 510 } | 516 } |
| 511 | 517 |
| 512 Uri _writeFileDirectives(String path, | 518 Uri _writeFileDirectives(String path, |
| 513 {List<String> imports: const [], List<String> exports: const []}) { | 519 {List<String> imports: const [], List<String> exports: const []}) { |
| 514 return writeFile(path, ''' | 520 return writeFile(path, ''' |
| 515 ${imports.map((uri) => 'import "$uri";').join('\n')} | 521 ${imports.map((uri) => 'import "$uri";').join('\n')} |
| 516 ${exports.map((uri) => 'export "$uri";').join('\n')} | 522 ${exports.map((uri) => 'export "$uri";').join('\n')} |
| 517 '''); | 523 '''); |
| 518 } | 524 } |
| 519 } | 525 } |
| OLD | NEW |