| 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.services.refactoring.move_files; | 5 library test.services.refactoring.move_files; |
| 6 | 6 |
| 7 import 'dart:async'; | 7 import 'dart:async'; |
| 8 | 8 |
| 9 import 'package:analysis_server/src/services/refactoring/refactoring.dart'; | 9 import 'package:analysis_server/src/services/refactoring/refactoring.dart'; |
| 10 import 'package:analyzer/file_system/file_system.dart'; | 10 import 'package:analyzer/file_system/file_system.dart'; |
| 11 import 'package:analyzer/source/package_map_resolver.dart'; | 11 import 'package:analyzer/source/package_map_resolver.dart'; |
| 12 import 'package:analyzer/src/generated/engine.dart'; | 12 import 'package:analyzer/src/generated/engine.dart'; |
| 13 import 'package:analyzer/src/generated/source.dart'; | 13 import 'package:analyzer/src/generated/source.dart'; |
| 14 import 'package:test_reflective_loader/test_reflective_loader.dart'; | 14 import 'package:test_reflective_loader/test_reflective_loader.dart'; |
| 15 | 15 |
| 16 import 'abstract_refactoring.dart'; | 16 import 'abstract_refactoring.dart'; |
| 17 | 17 |
| 18 main() { | 18 main() { |
| 19 defineReflectiveSuite(() { | 19 defineReflectiveSuite(() { |
| 20 defineReflectiveTests(MoveFileTest); | 20 defineReflectiveTests(MoveFileTest); |
| 21 }); | 21 }); |
| 22 } | 22 } |
| 23 | 23 |
| 24 @reflectiveTest | 24 @reflectiveTest |
| 25 class MoveFileTest extends RefactoringTest { | 25 class MoveFileTest extends RefactoringTest { |
| 26 MoveFileRefactoring refactoring; | 26 MoveFileRefactoring refactoring; |
| 27 | 27 |
| 28 @override |
| 29 bool get enableNewAnalysisDriver => false; |
| 30 |
| 28 test_file_definingUnit() async { | 31 test_file_definingUnit() async { |
| 29 String pathA = '/project/000/1111/a.dart'; | 32 String pathA = '/project/000/1111/a.dart'; |
| 30 String pathB = '/project/000/1111/b.dart'; | 33 String pathB = '/project/000/1111/b.dart'; |
| 31 String pathC = '/project/000/1111/22/c.dart'; | 34 String pathC = '/project/000/1111/22/c.dart'; |
| 32 String pathD = '/project/000/1111/333/d.dart'; | 35 String pathD = '/project/000/1111/333/d.dart'; |
| 33 testFile = '/project/000/1111/test.dart'; | 36 testFile = '/project/000/1111/test.dart'; |
| 34 addSource('/absolute/uri.dart', ''); | 37 addSource('/absolute/uri.dart', ''); |
| 35 addSource(pathA, 'part of lib;'); | 38 addSource(pathA, 'part of lib;'); |
| 36 addSource(pathB, "import 'test.dart';"); | 39 addSource(pathB, "import 'test.dart';"); |
| 37 addSource(pathC, ''); | 40 addSource(pathC, ''); |
| (...skipping 251 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 289 break; | 292 break; |
| 290 } | 293 } |
| 291 for (ChangeNotice notice in result.changeNotices) { | 294 for (ChangeNotice notice in result.changeNotices) { |
| 292 if (notice.source.fullName.startsWith('/project/')) { | 295 if (notice.source.fullName.startsWith('/project/')) { |
| 293 index.indexUnit(notice.resolvedDartUnit); | 296 index.indexUnit(notice.resolvedDartUnit); |
| 294 } | 297 } |
| 295 } | 298 } |
| 296 } | 299 } |
| 297 } | 300 } |
| 298 } | 301 } |
| OLD | NEW |