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/plugin/protocol/protocol.dart'; | 7 import 'package:analysis_server/plugin/protocol/protocol.dart'; |
8 import 'package:path/path.dart'; | 8 import 'package:path/path.dart' as path; |
9 import 'package:test/test.dart'; | 9 import 'package:test/test.dart'; |
10 import 'package:test_reflective_loader/test_reflective_loader.dart'; | 10 import 'package:test_reflective_loader/test_reflective_loader.dart'; |
11 | 11 |
12 import '../integration_tests.dart'; | 12 import '../integration_tests.dart'; |
13 | 13 |
14 main() { | 14 main() { |
15 defineReflectiveSuite(() { | 15 defineReflectiveSuite(() { |
16 defineReflectiveTests(Test); | 16 defineReflectiveTests(Test); |
17 }); | 17 }); |
18 } | 18 } |
19 | 19 |
20 @reflectiveTest | 20 @reflectiveTest |
21 class Test extends AbstractAnalysisServerIntegrationTest { | 21 class Test extends AbstractAnalysisServerIntegrationTest { |
22 test_package_root() { | 22 test_package_root() { |
23 String projPath = sourcePath('project'); | 23 String projPath = sourcePath('project'); |
24 String mainPath = join(projPath, 'main.dart'); | 24 String mainPath = path.join(projPath, 'main.dart'); |
25 String packagesPath = sourcePath('packages'); | 25 String packagesPath = sourcePath('packages'); |
26 String fooBarPath = join(packagesPath, 'foo', 'bar.dart'); | 26 String fooBarPath = path.join(packagesPath, 'foo', 'bar.dart'); |
27 String mainText = """ | 27 String mainText = """ |
28 library main; | 28 library main; |
29 | 29 |
30 import 'package:foo/bar.dart' | 30 import 'package:foo/bar.dart' |
31 | 31 |
32 main() { | 32 main() { |
33 f(); | 33 f(); |
34 } | 34 } |
35 """; | 35 """; |
36 String fooBarText = """ | 36 String fooBarText = """ |
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
70 navigationTargets[navigationTargetIndex]; | 70 navigationTargets[navigationTargetIndex]; |
71 String navigationFile = | 71 String navigationFile = |
72 navigationTargetFiles[navigationTarget.fileIndex]; | 72 navigationTargetFiles[navigationTarget.fileIndex]; |
73 expect(navigationFile, equals(normalizedFooBarPath)); | 73 expect(navigationFile, equals(normalizedFooBarPath)); |
74 } | 74 } |
75 } | 75 } |
76 expect(found, isTrue); | 76 expect(found, isTrue); |
77 }); | 77 }); |
78 } | 78 } |
79 } | 79 } |
OLD | NEW |