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

Side by Side Diff: pkg/analyzer_cli/test/driver_test.dart

Issue 1962403002: Fix CLI SDK option config timing (#26129). (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 4 years, 7 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 unified diff | Download patch
OLDNEW
1 // Copyright (c) 2015, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2015, 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 analyzer_cli.test.driver; 5 library analyzer_cli.test.driver;
6 6
7 import 'dart:io'; 7 import 'dart:io';
8 8
9 import 'package:analyzer/plugin/options.dart'; 9 import 'package:analyzer/plugin/options.dart';
10 import 'package:analyzer/source/analysis_options_provider.dart'; 10 import 'package:analyzer/source/analysis_options_provider.dart';
(...skipping 245 matching lines...) Expand 10 before | Expand all | Expand 10 after
256 outSink.toString(), 256 outSink.toString(),
257 contains( 257 contains(
258 "[error] This function declares a return type of 'int'")); 258 "[error] This function declares a return type of 'int'"));
259 expect(outSink.toString(), contains("1 error and 1 warning found.")); 259 expect(outSink.toString(), contains("1 error and 1 warning found."));
260 }); 260 });
261 261
262 test('language', () { 262 test('language', () {
263 doDrive(); 263 doDrive();
264 expect(driver.context.analysisOptions.enableSuperMixins, isTrue); 264 expect(driver.context.analysisOptions.enableSuperMixins, isTrue);
265 }); 265 });
266
267 test('strongMode', () {
268 doDrive();
269 expect(driver.context.analysisOptions.strongMode, isTrue);
270 //https://github.com/dart-lang/sdk/issues/26129
271 AnalysisContext sdkContext =
272 driver.context.sourceFactory.dartSdk.context;
273 expect(sdkContext.analysisOptions.strongMode, isTrue);
274 });
266 }); 275 });
267 276
268 group('with flags', () { 277 group('with flags', () {
269 // Shared driver command. 278 // Shared driver command.
270 var doDrive = () => drive('data/options_tests_project/test_file.dart', 279 var doDrive = () => drive('data/options_tests_project/test_file.dart',
271 args: ['--fatal-warnings'], 280 args: ['--fatal-warnings'],
272 options: 'data/options_tests_project/.analysis_options'); 281 options: 'data/options_tests_project/.analysis_options');
273 282
274 test('override fatal warning', () { 283 test('override fatal warning', () {
275 doDrive(); 284 doDrive();
(...skipping 233 matching lines...) Expand 10 before | Expand all | Expand 10 after
509 this.options = options; 518 this.options = options;
510 } 519 }
511 } 520 }
512 521
513 class TestSource implements Source { 522 class TestSource implements Source {
514 TestSource(); 523 TestSource();
515 524
516 @override 525 @override
517 noSuchMethod(Invocation invocation) => super.noSuchMethod(invocation); 526 noSuchMethod(Invocation invocation) => super.noSuchMethod(invocation);
518 } 527 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698