| OLD | NEW |
| (Empty) |
| 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 | |
| 3 // BSD-style license that can be found in the LICENSE file. | |
| 4 | |
| 5 import 'package:analysis_server/src/services/dependencies/library_dependencies.d
art'; | |
| 6 import 'package:test/test.dart'; | |
| 7 import 'package:test_reflective_loader/test_reflective_loader.dart'; | |
| 8 | |
| 9 import '../../abstract_context.dart'; | |
| 10 | |
| 11 main() { | |
| 12 defineReflectiveSuite(() { | |
| 13 defineReflectiveTests(LibraryDependenciesTest); | |
| 14 }); | |
| 15 } | |
| 16 | |
| 17 @reflectiveTest | |
| 18 class LibraryDependenciesTest extends AbstractContextTest { | |
| 19 @failingTest | |
| 20 test_LibraryDependencies() { | |
| 21 // See https://github.com/dart-lang/sdk/issues/29310 | |
| 22 addSource('/lib1.dart', 'import "lib2.dart";'); | |
| 23 addSource('/lib2.dart', 'import "lib1.dart";'); | |
| 24 addSource('/lib3.dart', 'import "lib2.dart";'); | |
| 25 addSource('/lib4.dart', 'import "lib5.dart";'); | |
| 26 provider.newFile('/lib5.dart', 'import "lib6.dart";'); | |
| 27 provider.newFile('/lib6.dart', ''); | |
| 28 | |
| 29 var libs = new LibraryDependencyCollector([]).collectLibraryDependencies(); | |
| 30 | |
| 31 // Cycles | |
| 32 expect(libs, contains('/lib1.dart')); | |
| 33 expect(libs, contains('/lib2.dart')); | |
| 34 // Regular sources | |
| 35 expect(libs, contains('/lib3.dart')); | |
| 36 expect(libs, contains('/lib4.dart')); | |
| 37 // Non-source, referenced by source | |
| 38 expect(libs, contains('/lib5.dart')); | |
| 39 // Non-source, referenced by non-source | |
| 40 expect(libs, contains('/lib6.dart')); | |
| 41 } | |
| 42 | |
| 43 test_PackageMaps() { | |
| 44 //TODO(pquitslund): add test | |
| 45 } | |
| 46 } | |
| OLD | NEW |