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.correction.fix; | 5 library test.services.correction.fix; |
6 | 6 |
7 import 'dart:async'; | 7 import 'dart:async'; |
8 | 8 |
9 import 'package:analysis_server/plugin/edit/fix/fix_core.dart'; | 9 import 'package:analysis_server/plugin/edit/fix/fix_core.dart'; |
10 import 'package:analysis_server/plugin/edit/fix/fix_dart.dart'; | 10 import 'package:analysis_server/plugin/edit/fix/fix_dart.dart'; |
(...skipping 1852 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1863 '''); | 1863 '''); |
1864 testFile = '/my/lib/test.dart'; | 1864 testFile = '/my/lib/test.dart'; |
1865 addTestSource( | 1865 addTestSource( |
1866 ''' | 1866 ''' |
1867 library my.lib; | 1867 library my.lib; |
1868 part 'my_part.dart'; | 1868 part 'my_part.dart'; |
1869 ''', | 1869 ''', |
1870 Uri.parse('package:my/test.dart')); | 1870 Uri.parse('package:my/test.dart')); |
1871 // configure SourceFactory | 1871 // configure SourceFactory |
1872 UriResolver pkgResolver = new PackageMapUriResolver(provider, { | 1872 UriResolver pkgResolver = new PackageMapUriResolver(provider, { |
1873 'my': [provider.getResource('/my/lib')], | 1873 'my': <Folder>[provider.getResource('/my/lib')], |
1874 }); | 1874 }); |
1875 context.sourceFactory = new SourceFactory( | 1875 context.sourceFactory = new SourceFactory( |
1876 [AbstractContextTest.SDK_RESOLVER, pkgResolver, resourceResolver]); | 1876 [AbstractContextTest.SDK_RESOLVER, pkgResolver, resourceResolver]); |
1877 // prepare fix | 1877 // prepare fix |
1878 testUnit = resolveLibraryUnit(testSource); | 1878 testUnit = resolveLibraryUnit(testSource); |
1879 AnalysisError error = _findErrorToFix(); | 1879 AnalysisError error = _findErrorToFix(); |
1880 fix = await _assertHasFix(DartFixKind.CREATE_FILE, error); | 1880 fix = await _assertHasFix(DartFixKind.CREATE_FILE, error); |
1881 change = fix.change; | 1881 change = fix.change; |
1882 // validate change | 1882 // validate change |
1883 List<SourceFileEdit> fileEdits = change.edits; | 1883 List<SourceFileEdit> fileEdits = change.edits; |
(...skipping 3491 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5375 @override | 5375 @override |
5376 void t() { } | 5376 void t() { } |
5377 } | 5377 } |
5378 '''); | 5378 '''); |
5379 } | 5379 } |
5380 | 5380 |
5381 void verifyResult(String expectedResult) { | 5381 void verifyResult(String expectedResult) { |
5382 expect(resultCode, expectedResult); | 5382 expect(resultCode, expectedResult); |
5383 } | 5383 } |
5384 } | 5384 } |
OLD | NEW |