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:analyzer/file_system/file_system.dart'; | 10 import 'package:analyzer/file_system/file_system.dart'; |
(...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
90 callbacks = new TestContextManagerCallbacks(resourceProvider); | 90 callbacks = new TestContextManagerCallbacks(resourceProvider); |
91 manager.callbacks = callbacks; | 91 manager.callbacks = callbacks; |
92 resourceProvider.newFolder(projPath); | 92 resourceProvider.newFolder(projPath); |
93 ContextManagerImpl.ENABLE_PACKAGESPEC_SUPPORT = true; | 93 ContextManagerImpl.ENABLE_PACKAGESPEC_SUPPORT = true; |
94 | 94 |
95 // Options processing is required in context creation. | 95 // Options processing is required in context creation. |
96 ExtensionManager em = new ExtensionManager(); | 96 ExtensionManager em = new ExtensionManager(); |
97 em.processPlugins([AnalysisEngine.instance.optionsPlugin]); | 97 em.processPlugins([AnalysisEngine.instance.optionsPlugin]); |
98 } | 98 } |
99 | 99 |
100 solo_test_strong_mode_analysis_option() async { | |
Jennifer Messerly
2015/10/13 20:01:02
remove "solo_"?
pquitslund
2015/10/13 20:10:58
Duh. Yeah. Thanks. Should have finished lunch! ;
| |
101 // Create files. | |
102 newFile( | |
103 [projPath, '.analysis_options'], | |
104 r''' | |
105 analyzer: | |
106 strong-mode: true | |
107 '''); | |
108 String libPath = newFolder([projPath, LIB_NAME]); | |
109 newFile([libPath, 'main.dart']); | |
110 // Setup context. | |
111 manager.setRoots(<String>[projPath], <String>[], <String, String>{}); | |
112 // Verify that analysis options was parsed and strong-mode set. | |
113 Map<String, int> fileTimestamps = | |
114 callbacks.currentContextFilePaths[projPath]; | |
115 expect(fileTimestamps, isNotEmpty); | |
116 expect(callbacks.currentContext.analysisOptions.strongMode, true); | |
117 } | |
118 | |
100 void tearDown() { | 119 void tearDown() { |
101 ContextManagerImpl.ENABLE_PACKAGESPEC_SUPPORT = false; | 120 ContextManagerImpl.ENABLE_PACKAGESPEC_SUPPORT = false; |
102 } | 121 } |
103 | 122 |
104 test_analysis_options_parse_failure() async { | 123 test_analysis_options_parse_failure() async { |
105 // Create files. | 124 // Create files. |
106 String libPath = newFolder([projPath, LIB_NAME]); | 125 String libPath = newFolder([projPath, LIB_NAME]); |
107 newFile([libPath, 'main.dart']); | 126 newFile([libPath, 'main.dart']); |
108 String sdkExtPath = newFolder([projPath, 'sdk_ext']); | 127 String sdkExtPath = newFolder([projPath, 'sdk_ext']); |
109 newFile([sdkExtPath, 'entry.dart']); | 128 newFile([sdkExtPath, 'entry.dart']); |
(...skipping 1690 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1800 class TestUriResolver extends UriResolver { | 1819 class TestUriResolver extends UriResolver { |
1801 Map<Uri, Source> uriMap; | 1820 Map<Uri, Source> uriMap; |
1802 | 1821 |
1803 TestUriResolver(this.uriMap); | 1822 TestUriResolver(this.uriMap); |
1804 | 1823 |
1805 @override | 1824 @override |
1806 Source resolveAbsolute(Uri uri, [Uri actualUri]) { | 1825 Source resolveAbsolute(Uri uri, [Uri actualUri]) { |
1807 return uriMap[uri]; | 1826 return uriMap[uri]; |
1808 } | 1827 } |
1809 } | 1828 } |
OLD | NEW |