OLD | NEW |
1 // Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2014, 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 engine.compile_time_error_code_test; | 5 library engine.compile_time_error_code_test; |
6 | 6 |
7 import 'package:analyzer/src/generated/engine.dart'; | 7 import 'package:analyzer/src/generated/engine.dart'; |
8 import 'package:analyzer/src/generated/error.dart'; | 8 import 'package:analyzer/src/generated/error.dart'; |
9 import 'package:analyzer/src/generated/parser.dart' show ParserErrorCode; | 9 import 'package:analyzer/src/generated/parser.dart' show ParserErrorCode; |
10 import 'package:analyzer/src/generated/source_io.dart'; | 10 import 'package:analyzer/src/generated/source_io.dart'; |
(...skipping 4687 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4698 void test_partOfNonPart() { | 4698 void test_partOfNonPart() { |
4699 Source source = addSource(r''' | 4699 Source source = addSource(r''' |
4700 library l1; | 4700 library l1; |
4701 part 'l2.dart';'''); | 4701 part 'l2.dart';'''); |
4702 addNamedSource("/l2.dart", "library l2;"); | 4702 addNamedSource("/l2.dart", "library l2;"); |
4703 computeLibrarySourceErrors(source); | 4703 computeLibrarySourceErrors(source); |
4704 assertErrors(source, [CompileTimeErrorCode.PART_OF_NON_PART]); | 4704 assertErrors(source, [CompileTimeErrorCode.PART_OF_NON_PART]); |
4705 verify([source]); | 4705 verify([source]); |
4706 } | 4706 } |
4707 | 4707 |
| 4708 void test_partOfNonPart_self() { |
| 4709 Source source = addSource(r''' |
| 4710 library lib; |
| 4711 part 'test.dart';'''); |
| 4712 computeLibrarySourceErrors(source); |
| 4713 assertErrors(source, [CompileTimeErrorCode.PART_OF_NON_PART]); |
| 4714 verify([source]); |
| 4715 } |
| 4716 |
4708 void test_prefix_conditionalPropertyAccess_call() { | 4717 void test_prefix_conditionalPropertyAccess_call() { |
4709 AnalysisOptionsImpl options = new AnalysisOptionsImpl(); | 4718 AnalysisOptionsImpl options = new AnalysisOptionsImpl(); |
4710 options.enableNullAwareOperators = true; | 4719 options.enableNullAwareOperators = true; |
4711 resetWithOptions(options); | 4720 resetWithOptions(options); |
4712 addNamedSource('/lib.dart', ''' | 4721 addNamedSource('/lib.dart', ''' |
4713 library lib; | 4722 library lib; |
4714 g() {} | 4723 g() {} |
4715 '''); | 4724 '''); |
4716 Source source = addSource(''' | 4725 Source source = addSource(''' |
4717 import 'lib.dart' as p; | 4726 import 'lib.dart' as p; |
(...skipping 1328 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
6046 source, [CompileTimeErrorCode.WRONG_NUMBER_OF_PARAMETERS_FOR_OPERATOR]); | 6055 source, [CompileTimeErrorCode.WRONG_NUMBER_OF_PARAMETERS_FOR_OPERATOR]); |
6047 verify([source]); | 6056 verify([source]); |
6048 reset(); | 6057 reset(); |
6049 } | 6058 } |
6050 | 6059 |
6051 void _check_wrongNumberOfParametersForOperator1(String name) { | 6060 void _check_wrongNumberOfParametersForOperator1(String name) { |
6052 _check_wrongNumberOfParametersForOperator(name, ""); | 6061 _check_wrongNumberOfParametersForOperator(name, ""); |
6053 _check_wrongNumberOfParametersForOperator(name, "a, b"); | 6062 _check_wrongNumberOfParametersForOperator(name, "a, b"); |
6054 } | 6063 } |
6055 } | 6064 } |
OLD | NEW |