| 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/source_io.dart'; | 7 import 'package:analyzer/src/generated/source_io.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/engine.dart'; | 10 import 'package:analyzer/src/generated/engine.dart'; |
| (...skipping 4637 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4648 Source source = addSource(r''' | 4648 Source source = addSource(r''' |
| 4649 class A { | 4649 class A { |
| 4650 set x(a, b) {} | 4650 set x(a, b) {} |
| 4651 }'''); | 4651 }'''); |
| 4652 resolve(source); | 4652 resolve(source); |
| 4653 assertErrors(source, [CompileTimeErrorCode.WRONG_NUMBER_OF_PARAMETERS_FOR_SE
TTER]); | 4653 assertErrors(source, [CompileTimeErrorCode.WRONG_NUMBER_OF_PARAMETERS_FOR_SE
TTER]); |
| 4654 verify([source]); | 4654 verify([source]); |
| 4655 } | 4655 } |
| 4656 | 4656 |
| 4657 void _check_constEvalThrowsException_binary_null(String expr, bool resolved) { | 4657 void _check_constEvalThrowsException_binary_null(String expr, bool resolved) { |
| 4658 Source source = addSource("const C = ${expr};"); | 4658 Source source = addSource("const C = $expr;"); |
| 4659 resolve(source); | 4659 resolve(source); |
| 4660 if (resolved) { | 4660 if (resolved) { |
| 4661 assertErrors(source, [CompileTimeErrorCode.CONST_EVAL_THROWS_EXCEPTION]); | 4661 assertErrors(source, [CompileTimeErrorCode.CONST_EVAL_THROWS_EXCEPTION]); |
| 4662 verify([source]); | 4662 verify([source]); |
| 4663 } else { | 4663 } else { |
| 4664 assertErrors(source, [CompileTimeErrorCode.CONST_EVAL_THROWS_EXCEPTION]); | 4664 assertErrors(source, [CompileTimeErrorCode.CONST_EVAL_THROWS_EXCEPTION]); |
| 4665 // no verify(), 'null x' is not resolved | 4665 // no verify(), 'null x' is not resolved |
| 4666 } | 4666 } |
| 4667 reset(); | 4667 reset(); |
| 4668 } | 4668 } |
| (...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4723 void _check_wrongNumberOfParametersForOperator1(String name) { | 4723 void _check_wrongNumberOfParametersForOperator1(String name) { |
| 4724 _check_wrongNumberOfParametersForOperator(name, ""); | 4724 _check_wrongNumberOfParametersForOperator(name, ""); |
| 4725 _check_wrongNumberOfParametersForOperator(name, "a, b"); | 4725 _check_wrongNumberOfParametersForOperator(name, "a, b"); |
| 4726 } | 4726 } |
| 4727 } | 4727 } |
| 4728 | 4728 |
| 4729 main() { | 4729 main() { |
| 4730 _ut.groupSep = ' | '; | 4730 _ut.groupSep = ' | '; |
| 4731 runReflectiveTests(CompileTimeErrorCodeTest); | 4731 runReflectiveTests(CompileTimeErrorCodeTest); |
| 4732 } | 4732 } |
| OLD | NEW |