OLD | NEW |
1 // Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2014, 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 library test.integration.analysis.packageRoot; | 5 library test.integration.analysis.packageRoot; |
6 | 6 |
7 import 'package:analysis_server/src/protocol.dart'; | 7 import 'package:analysis_server/src/protocol.dart'; |
8 import 'package:path/path.dart'; | 8 import 'package:path/path.dart'; |
9 import 'package:unittest/unittest.dart'; | 9 import 'package:unittest/unittest.dart'; |
10 | 10 |
11 import '../../reflective_tests.dart'; | 11 import '../../reflective_tests.dart'; |
12 import '../integration_tests.dart'; | 12 import '../integration_tests.dart'; |
13 | 13 |
14 main() { | 14 main() { |
15 runReflectiveTests(Test); | 15 runReflectiveTests(Test); |
16 } | 16 } |
17 | 17 |
18 @ReflectiveTestCase() | 18 @reflectiveTest |
19 class Test extends AbstractAnalysisServerIntegrationTest { | 19 class Test extends AbstractAnalysisServerIntegrationTest { |
20 test_package_root() { | 20 test_package_root() { |
21 String projPath = sourcePath('project'); | 21 String projPath = sourcePath('project'); |
22 String mainPath = join(projPath, 'main.dart'); | 22 String mainPath = join(projPath, 'main.dart'); |
23 String packagesPath = sourcePath('packages'); | 23 String packagesPath = sourcePath('packages'); |
24 String fooBarPath = join(packagesPath, 'foo', 'bar.dart'); | 24 String fooBarPath = join(packagesPath, 'foo', 'bar.dart'); |
25 String mainText = """ | 25 String mainText = """ |
26 library main; | 26 library main; |
27 | 27 |
28 import 'package:foo/bar.dart' | 28 import 'package:foo/bar.dart' |
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
67 int navigationTargetIndex = region.targets[0]; | 67 int navigationTargetIndex = region.targets[0]; |
68 NavigationTarget navigationTarget = navigationTargets[navigationTarget
Index]; | 68 NavigationTarget navigationTarget = navigationTargets[navigationTarget
Index]; |
69 String navigationFile = navigationTargetFiles[navigationTarget.fileInd
ex]; | 69 String navigationFile = navigationTargetFiles[navigationTarget.fileInd
ex]; |
70 expect(navigationFile, equals(normalizedFooBarPath)); | 70 expect(navigationFile, equals(normalizedFooBarPath)); |
71 } | 71 } |
72 } | 72 } |
73 expect(found, isTrue); | 73 expect(found, isTrue); |
74 }); | 74 }); |
75 } | 75 } |
76 } | 76 } |
OLD | NEW |