| OLD | NEW |
| 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.options; | 5 library analyzer_cli.test.options; |
| 6 | 6 |
| 7 import 'dart:io'; | 7 import 'dart:io'; |
| 8 | 8 |
| 9 import 'package:analyzer_cli/src/driver.dart'; | 9 import 'package:analyzer_cli/src/driver.dart'; |
| 10 import 'package:analyzer_cli/src/options.dart'; | 10 import 'package:analyzer_cli/src/options.dart'; |
| (...skipping 239 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 250 ]); | 250 ]); |
| 251 expect(options.buildMode, isTrue); | 251 expect(options.buildMode, isTrue); |
| 252 expect(options.buildAnalysisOutput, '//path/to/output.analysis'); | 252 expect(options.buildAnalysisOutput, '//path/to/output.analysis'); |
| 253 } | 253 } |
| 254 | 254 |
| 255 test_buildMode() { | 255 test_buildMode() { |
| 256 _parse(['--build-mode', 'package:p/foo.dart|/path/to/p/lib/foo.dart']); | 256 _parse(['--build-mode', 'package:p/foo.dart|/path/to/p/lib/foo.dart']); |
| 257 expect(options.buildMode, isTrue); | 257 expect(options.buildMode, isTrue); |
| 258 } | 258 } |
| 259 | 259 |
| 260 test_buildMode_allowsEmptyFileList() { |
| 261 _parse(['--build-mode']); |
| 262 expect(options.buildMode, isTrue); |
| 263 expect(options.sourceFiles, isEmpty); |
| 264 } |
| 265 |
| 260 test_buildSummaryFallback() { | 266 test_buildSummaryFallback() { |
| 261 _parse([ | 267 _parse([ |
| 262 '--build-mode', | 268 '--build-mode', |
| 263 '--build-summary-output=//path/to/output.sum', | 269 '--build-summary-output=//path/to/output.sum', |
| 264 '--build-summary-fallback', | 270 '--build-summary-fallback', |
| 265 'package:p/foo.dart|/path/to/p/lib/foo.dart' | 271 'package:p/foo.dart|/path/to/p/lib/foo.dart' |
| 266 ]); | 272 ]); |
| 267 expect(options.buildMode, isTrue); | 273 expect(options.buildMode, isTrue); |
| 268 expect(options.buildSummaryFallback, isTrue); | 274 expect(options.buildSummaryFallback, isTrue); |
| 269 } | 275 } |
| (...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 319 'package:p/foo.dart|/path/to/p/lib/foo.dart' | 325 'package:p/foo.dart|/path/to/p/lib/foo.dart' |
| 320 ]); | 326 ]); |
| 321 expect(options.buildMode, isTrue); | 327 expect(options.buildMode, isTrue); |
| 322 expect(options.buildSuppressExitCode, isTrue); | 328 expect(options.buildSuppressExitCode, isTrue); |
| 323 } | 329 } |
| 324 | 330 |
| 325 void _parse(List<String> args) { | 331 void _parse(List<String> args) { |
| 326 options = CommandLineOptions.parse(args); | 332 options = CommandLineOptions.parse(args); |
| 327 } | 333 } |
| 328 } | 334 } |
| OLD | NEW |