| OLD | NEW |
| 1 // Copyright (c) 2016, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2016, 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.test.src.context.context_builder_test; | 5 library analyzer.test.src.context.context_builder_test; |
| 6 | 6 |
| 7 import 'package:analyzer/file_system/file_system.dart'; | 7 import 'package:analyzer/file_system/file_system.dart'; |
| 8 import 'package:analyzer/file_system/memory_file_system.dart'; | 8 import 'package:analyzer/file_system/memory_file_system.dart'; |
| 9 import 'package:analyzer/source/package_map_resolver.dart'; | 9 import 'package:analyzer/source/package_map_resolver.dart'; |
| 10 import 'package:analyzer/src/command_line/arguments.dart'; | 10 import 'package:analyzer/src/command_line/arguments.dart'; |
| (...skipping 717 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 728 flutter:/pkg/flutter/lib/ | 728 flutter:/pkg/flutter/lib/ |
| 729 '''); | 729 '''); |
| 730 createFile( | 730 createFile( |
| 731 resourceProvider | 731 resourceProvider |
| 732 .convertPath('/pkg/flutter/lib/analysis_options_user.yaml'), | 732 .convertPath('/pkg/flutter/lib/analysis_options_user.yaml'), |
| 733 ''' | 733 ''' |
| 734 linter: | 734 linter: |
| 735 rules: | 735 rules: |
| 736 - mock_lint_rule | 736 - mock_lint_rule |
| 737 '''); | 737 '''); |
| 738 String projPath = resourceProvider.convertPath('/some/directory/path'); | 738 AnalysisOptions options = builder.getAnalysisOptions( |
| 739 AnalysisOptions options = builder.getAnalysisOptions(projPath); | 739 resourceProvider.convertPath('/some/directory/path')); |
| 740 // TODO(danrubel) fix on Windows | 740 // TODO(danrubel) fix on Windows |
| 741 if (resourceProvider.absolutePathContext.separator != r'\') { | 741 if (resourceProvider.absolutePathContext.separator != r'\') { |
| 742 _expectEqualOptions(options, expected); | 742 _expectEqualOptions(options, expected); |
| 743 } else { | |
| 744 // echo some debugging information | |
| 745 print('>>> projPath: $projPath'); | |
| 746 print('>>> ${builderOptions.defaultAnalysisOptionsFilePath}'); | |
| 747 print('>>> getOptionsFile: ${builder.getOptionsFile(projPath)}'); | |
| 748 fail('>>>>>>> Fail to echo test output on bots <<<<<<<'); | |
| 749 } | 743 } |
| 750 } | 744 } |
| 751 | 745 |
| 752 void test_getAnalysisOptions_default_noOverrides() { | 746 void test_getAnalysisOptions_default_noOverrides() { |
| 753 AnalysisOptionsImpl defaultOptions = new AnalysisOptionsImpl(); | 747 AnalysisOptionsImpl defaultOptions = new AnalysisOptionsImpl(); |
| 754 defaultOptions.enableLazyAssignmentOperators = true; | 748 defaultOptions.enableLazyAssignmentOperators = true; |
| 755 builderOptions.defaultOptions = defaultOptions; | 749 builderOptions.defaultOptions = defaultOptions; |
| 756 AnalysisOptionsImpl expected = new AnalysisOptionsImpl(); | 750 AnalysisOptionsImpl expected = new AnalysisOptionsImpl(); |
| 757 expected.enableLazyAssignmentOperators = true; | 751 expected.enableLazyAssignmentOperators = true; |
| 758 String path = resourceProvider.convertPath('/some/directory/path'); | 752 String path = resourceProvider.convertPath('/some/directory/path'); |
| (...skipping 260 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1019 class _MockLintRule implements LintRule { | 1013 class _MockLintRule implements LintRule { |
| 1020 final String _name; | 1014 final String _name; |
| 1021 | 1015 |
| 1022 _MockLintRule(this._name); | 1016 _MockLintRule(this._name); |
| 1023 | 1017 |
| 1024 @override | 1018 @override |
| 1025 String get name => _name; | 1019 String get name => _name; |
| 1026 | 1020 |
| 1027 noSuchMethod(Invocation invocation) => super.noSuchMethod(invocation); | 1021 noSuchMethod(Invocation invocation) => super.noSuchMethod(invocation); |
| 1028 } | 1022 } |
| OLD | NEW |