| 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.context.directory.manager; | 5 library test.context.directory.manager; |
| 6 | 6 |
| 7 import 'dart:collection'; | 7 import 'dart:collection'; |
| 8 | 8 |
| 9 import 'package:analysis_server/src/context_manager.dart'; | 9 import 'package:analysis_server/src/context_manager.dart'; |
| 10 import 'package:analysis_server/src/utilities/null_string_sink.dart'; | 10 import 'package:analysis_server/src/utilities/null_string_sink.dart'; |
| (...skipping 2313 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2324 expect(sdkContext.analysisOptions.strongMode, isTrue); | 2324 expect(sdkContext.analysisOptions.strongMode, isTrue); |
| 2325 // The code is strong-mode clean. | 2325 // The code is strong-mode clean. |
| 2326 // Verify that TypeSystem was reset. | 2326 // Verify that TypeSystem was reset. |
| 2327 expect(result.errors, isEmpty); | 2327 expect(result.errors, isEmpty); |
| 2328 } else { | 2328 } else { |
| 2329 AnalysisContext context = manager.getContextFor(projPath); | 2329 AnalysisContext context = manager.getContextFor(projPath); |
| 2330 Source testSource = context.getSourcesWithFullName(file.path).single; | 2330 Source testSource = context.getSourcesWithFullName(file.path).single; |
| 2331 AnalysisContext sdkContext = sourceFactory.dartSdk.context; | 2331 AnalysisContext sdkContext = sourceFactory.dartSdk.context; |
| 2332 expect(analysisOptions.strongMode, isTrue); | 2332 expect(analysisOptions.strongMode, isTrue); |
| 2333 expect(sdkContext.analysisOptions.strongMode, isTrue); | 2333 expect(sdkContext.analysisOptions.strongMode, isTrue); |
| 2334 // The code is strong-mode clean, but we're using a Mock SDK that isn't | 2334 // The code is strong-mode clean. |
| 2335 // configured correctly for strong mode so we get an error. | |
| 2336 // Verify that TypeSystem was reset. | 2335 // Verify that TypeSystem was reset. |
| 2337 expect(context.computeErrors(testSource), hasLength(1)); | 2336 expect(context.computeErrors(testSource), isEmpty); |
| 2338 } | 2337 } |
| 2339 } | 2338 } |
| 2340 | 2339 |
| 2341 test_path_filter_analysis_option() async { | 2340 test_path_filter_analysis_option() async { |
| 2342 // Create files. | 2341 // Create files. |
| 2343 String libPath = newFolder([projPath, ContextManagerTest.LIB_NAME]); | 2342 String libPath = newFolder([projPath, ContextManagerTest.LIB_NAME]); |
| 2344 newFile([libPath, 'main.dart']); | 2343 newFile([libPath, 'main.dart']); |
| 2345 newFile([libPath, 'nope.dart']); | 2344 newFile([libPath, 'nope.dart']); |
| 2346 String sdkExtPath = newFolder([projPath, 'sdk_ext']); | 2345 String sdkExtPath = newFolder([projPath, 'sdk_ext']); |
| 2347 newFile([sdkExtPath, 'entry.dart']); | 2346 newFile([sdkExtPath, 'entry.dart']); |
| (...skipping 549 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2897 class TestUriResolver extends UriResolver { | 2896 class TestUriResolver extends UriResolver { |
| 2898 Map<Uri, Source> uriMap; | 2897 Map<Uri, Source> uriMap; |
| 2899 | 2898 |
| 2900 TestUriResolver(this.uriMap); | 2899 TestUriResolver(this.uriMap); |
| 2901 | 2900 |
| 2902 @override | 2901 @override |
| 2903 Source resolveAbsolute(Uri uri, [Uri actualUri]) { | 2902 Source resolveAbsolute(Uri uri, [Uri actualUri]) { |
| 2904 return uriMap[uri]; | 2903 return uriMap[uri]; |
| 2905 } | 2904 } |
| 2906 } | 2905 } |
| OLD | NEW |