Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(420)

Unified Diff: pkg/analyzer/test/generated/all_the_rest_test.dart

Issue 1830703002: Pass AnalysisOptions into SdkCreator, disable changing afterwards. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 4 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « pkg/analyzer/lib/src/generated/sdk_io.dart ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/analyzer/test/generated/all_the_rest_test.dart
diff --git a/pkg/analyzer/test/generated/all_the_rest_test.dart b/pkg/analyzer/test/generated/all_the_rest_test.dart
index 33db261181f126587dc982b4fbfe2dac20310c04..8476223be7c4dbf80c431f64059162b5e34a0f60 100644
--- a/pkg/analyzer/test/generated/all_the_rest_test.dart
+++ b/pkg/analyzer/test/generated/all_the_rest_test.dart
@@ -155,6 +155,24 @@ class DirectoryBasedDartSdkTest {
expect(docFile, isNotNull);
}
+ void test_analysisOptions_afterContextCreation() {
+ DirectoryBasedDartSdk sdk = _createDartSdk();
+ sdk.context;
+ expect(() {
+ sdk.analysisOptions = new AnalysisOptionsImpl();
+ }, throwsStateError);
+ }
+
+ void test_analysisOptions_beforeContextCreation() {
+ DirectoryBasedDartSdk sdk = _createDartSdk();
+ sdk.analysisOptions = new AnalysisOptionsImpl();
+ sdk.context;
+ // cannot change "analysisOptions" in the context
+ expect(() {
+ sdk.context.analysisOptions = new AnalysisOptionsImpl();
+ }, throwsStateError);
+ }
+
void test_creation() {
DirectoryBasedDartSdk sdk = _createDartSdk();
expect(sdk, isNotNull);
@@ -262,6 +280,20 @@ class DirectoryBasedDartSdkTest {
expect(executable.isExecutable(), isTrue);
}
+ void test_useSummary_afterContextCreation() {
+ DirectoryBasedDartSdk sdk = _createDartSdk();
+ sdk.context;
+ expect(() {
+ sdk.useSummary = true;
+ }, throwsStateError);
+ }
+
+ void test_useSummary_beforeContextCreation() {
+ DirectoryBasedDartSdk sdk = _createDartSdk();
+ sdk.useSummary = true;
+ sdk.context;
+ }
+
DirectoryBasedDartSdk _createDartSdk() {
JavaFile sdkDirectory = DirectoryBasedDartSdk.defaultSdkDirectory;
expect(sdkDirectory, isNotNull,
« no previous file with comments | « pkg/analyzer/lib/src/generated/sdk_io.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698