@@ -212,6 +212,74 @@ workspaces
212
212
''' );
213
213
}
214
214
215
+ /// Verify the type of invalid data in
216
+ /// https://github.com/dart-lang/sdk/issues/55594 doesn't result in unhandled
217
+ /// exceptions when building contexts.
218
+ test_basicWorkspace_invalidAnalysisOption_issue55594 () async {
219
+ var workspaceRootPath = '/home' ;
220
+ var testPackageRootPath = '$workspaceRootPath /test' ;
221
+ newFile ('$testPackageRootPath /lib/a.dart' , '' );
222
+
223
+ newAnalysisOptionsYamlFile (testPackageRootPath, '''
224
+ linter:
225
+ rules:
226
+ - camel_case_types
227
+ - file_names
228
+ - non_constant_identifier_names
229
+ - comment_references
230
+ -
231
+ ''' );
232
+
233
+ _assertWorkspaceCollectionText (workspaceRootPath, r'''
234
+ contexts
235
+ /home
236
+ workspace: workspace_0
237
+ analyzedFiles
238
+ /home/test/lib/a.dart
239
+ analysisOptions_0
240
+ workspacePackage_0_0
241
+ analysisOptions
242
+ analysisOptions_0: /home/test/analysis_options.yaml
243
+ workspaces
244
+ workspace_0: BasicWorkspace
245
+ root: /home
246
+ workspacePackage_0_0
247
+ ''' );
248
+ }
249
+
250
+ /// Verify the type of invalid data in
251
+ /// https://github.com/dart-lang/sdk/issues/56577 doesn't result in unhandled
252
+ /// exceptions when building contexts.
253
+ test_basicWorkspace_invalidAnalysisOption_issue56577 () async {
254
+ var workspaceRootPath = '/home' ;
255
+ var testPackageRootPath = '$workspaceRootPath /test' ;
256
+ newFile ('$testPackageRootPath /lib/a.dart' , '' );
257
+
258
+ newAnalysisOptionsYamlFile (testPackageRootPath, '''
259
+ linter:
260
+ rules:
261
+ analyzer:
262
+ errors:
263
+ todo: ignore
264
+ ''' );
265
+
266
+ _assertWorkspaceCollectionText (workspaceRootPath, r'''
267
+ contexts
268
+ /home
269
+ workspace: workspace_0
270
+ analyzedFiles
271
+ /home/test/lib/a.dart
272
+ analysisOptions_0
273
+ workspacePackage_0_0
274
+ analysisOptions
275
+ analysisOptions_0: /home/test/analysis_options.yaml
276
+ workspaces
277
+ workspace_0: BasicWorkspace
278
+ root: /home
279
+ workspacePackage_0_0
280
+ ''' );
281
+ }
282
+
215
283
test_packageConfigWorkspace_enabledExperiment () async {
216
284
configuration.withEnabledFeatures = true ;
217
285
0 commit comments