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 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
48 }); | 48 }); |
49 | 49 |
50 test('batch', () { | 50 test('batch', () { |
51 CommandLineOptions options = | 51 CommandLineOptions options = |
52 CommandLineOptions.parse(['--dart-sdk', '.', '--batch']); | 52 CommandLineOptions.parse(['--dart-sdk', '.', '--batch']); |
53 expect(options.shouldBatch, isTrue); | 53 expect(options.shouldBatch, isTrue); |
54 }); | 54 }); |
55 | 55 |
56 test('defined variables', () { | 56 test('defined variables', () { |
57 CommandLineOptions options = CommandLineOptions | 57 CommandLineOptions options = CommandLineOptions |
58 .parse(['--dart-sdk', '.', '-Dfoo=bar', '-Da', 'b', 'foo.dart']); | 58 .parse(['--dart-sdk', '.', '-Dfoo=bar', 'foo.dart']); |
59 expect(options.definedVariables['foo'], equals('bar')); | 59 expect(options.definedVariables['foo'], equals('bar')); |
60 expect(options.definedVariables['bar'], isNull); | 60 expect(options.definedVariables['bar'], isNull); |
61 expect(options.definedVariables['a'], equals('b')); | |
62 expect(options.definedVariables['b'], isNull); | |
63 }); | 61 }); |
64 | 62 |
65 test('disable cache flushing', () { | 63 test('disable cache flushing', () { |
66 CommandLineOptions options = CommandLineOptions | 64 CommandLineOptions options = CommandLineOptions |
67 .parse(['--dart-sdk', '.', '--disable-cache-flushing', 'foo.dart']); | 65 .parse(['--dart-sdk', '.', '--disable-cache-flushing', 'foo.dart']); |
68 expect(options.disableCacheFlushing, isTrue); | 66 expect(options.disableCacheFlushing, isTrue); |
69 }); | 67 }); |
70 | 68 |
71 test('enable strict call checks', () { | 69 test('enable strict call checks', () { |
72 CommandLineOptions options = CommandLineOptions.parse( | 70 CommandLineOptions options = CommandLineOptions.parse( |
(...skipping 262 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
335 'package:p/foo.dart|/path/to/p/lib/foo.dart' | 333 'package:p/foo.dart|/path/to/p/lib/foo.dart' |
336 ]); | 334 ]); |
337 expect(options.buildMode, isTrue); | 335 expect(options.buildMode, isTrue); |
338 expect(options.buildSuppressExitCode, isTrue); | 336 expect(options.buildSuppressExitCode, isTrue); |
339 } | 337 } |
340 | 338 |
341 void _parse(List<String> args) { | 339 void _parse(List<String> args) { |
342 options = CommandLineOptions.parse(args); | 340 options = CommandLineOptions.parse(args); |
343 } | 341 } |
344 } | 342 } |
OLD | NEW |