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/error.dart'; | 7 import 'package:analyzer/src/generated/error.dart'; |
8 import 'package:analyzer/src/generated/parser.dart' show ParserErrorCode; | 8 import 'package:analyzer/src/generated/parser.dart' show ParserErrorCode; |
9 import 'package:analyzer/src/generated/source_io.dart'; | 9 import 'package:analyzer/src/generated/source_io.dart'; |
10 import 'package:unittest/unittest.dart' as _ut; | 10 import 'package:unittest/unittest.dart' as _ut; |
11 | 11 |
12 import '../reflective_tests.dart'; | 12 import '../reflective_tests.dart'; |
13 import 'resolver_test.dart'; | 13 import 'resolver_test.dart'; |
14 | 14 |
15 | 15 |
16 main() { | 16 main() { |
17 _ut.groupSep = ' | '; | 17 _ut.groupSep = ' | '; |
18 runReflectiveTests(CompileTimeErrorCodeTest); | 18 runReflectiveTests(CompileTimeErrorCodeTest); |
19 } | 19 } |
20 | 20 |
21 @ReflectiveTestCase() | 21 @reflectiveTest |
22 class CompileTimeErrorCodeTest extends ResolverTestCase { | 22 class CompileTimeErrorCodeTest extends ResolverTestCase { |
23 void fail_compileTimeConstantRaisesException() { | 23 void fail_compileTimeConstantRaisesException() { |
24 Source source = addSource(r''' | 24 Source source = addSource(r''' |
25 '''); | 25 '''); |
26 resolve(source); | 26 resolve(source); |
27 assertErrors( | 27 assertErrors( |
28 source, | 28 source, |
29 [CompileTimeErrorCode.COMPILE_TIME_CONSTANT_RAISES_EXCEPTION]); | 29 [CompileTimeErrorCode.COMPILE_TIME_CONSTANT_RAISES_EXCEPTION]); |
30 verify([source]); | 30 verify([source]); |
31 } | 31 } |
(...skipping 5382 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5414 [CompileTimeErrorCode.WRONG_NUMBER_OF_PARAMETERS_FOR_OPERATOR]); | 5414 [CompileTimeErrorCode.WRONG_NUMBER_OF_PARAMETERS_FOR_OPERATOR]); |
5415 verify([source]); | 5415 verify([source]); |
5416 reset(); | 5416 reset(); |
5417 } | 5417 } |
5418 | 5418 |
5419 void _check_wrongNumberOfParametersForOperator1(String name) { | 5419 void _check_wrongNumberOfParametersForOperator1(String name) { |
5420 _check_wrongNumberOfParametersForOperator(name, ""); | 5420 _check_wrongNumberOfParametersForOperator(name, ""); |
5421 _check_wrongNumberOfParametersForOperator(name, "a, b"); | 5421 _check_wrongNumberOfParametersForOperator(name, "a, b"); |
5422 } | 5422 } |
5423 } | 5423 } |
OLD | NEW |