Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(32)

Side by Side Diff: pkg/analyzer/test/generated/hint_code_test.dart

Issue 2628743002: Run the most of error generating tests with the new analysis driver. (Closed)
Patch Set: Created 3 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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.generated.hint_code_test; 5 library analyzer.test.generated.hint_code_test;
6 6
7 import 'package:analyzer/error/error.dart'; 7 import 'package:analyzer/error/error.dart';
8 import 'package:analyzer/src/error/codes.dart'; 8 import 'package:analyzer/src/error/codes.dart';
9 import 'package:analyzer/src/generated/engine.dart'; 9 import 'package:analyzer/src/generated/engine.dart';
10 import 'package:analyzer/src/generated/parser.dart'; 10 import 'package:analyzer/src/generated/parser.dart';
11 import 'package:analyzer/src/generated/source_io.dart'; 11 import 'package:analyzer/src/generated/source_io.dart';
12 import 'package:test/test.dart'; 12 import 'package:test/test.dart';
13 import 'package:test_reflective_loader/test_reflective_loader.dart'; 13 import 'package:test_reflective_loader/test_reflective_loader.dart';
14 14
15 import 'analysis_context_factory.dart';
16 import 'resolver_test_case.dart'; 15 import 'resolver_test_case.dart';
17 16
18 main() { 17 main() {
19 defineReflectiveSuite(() { 18 defineReflectiveSuite(() {
20 defineReflectiveTests(HintCodeTest); 19 defineReflectiveTests(HintCodeTest);
20 defineReflectiveTests(HintCodeTest_Driver);
21 }); 21 });
22 } 22 }
23 23
24 @reflectiveTest 24 @reflectiveTest
25 class HintCodeTest extends ResolverTestCase { 25 class HintCodeTest extends ResolverTestCase {
26 @override 26 @override
27 void reset() { 27 void reset({List<List<String>> packages}) {
28 analysisContext2 = AnalysisContextFactory.contextWithCoreAndPackages({ 28 super.reset(packages: [
29 'package:meta/meta.dart': r''' 29 [
30 'meta',
31 r'''
30 library meta; 32 library meta;
31 33
32 const _Factory factory = const _Factory(); 34 const _Factory factory = const _Factory();
33 const _Literal literal = const _Literal(); 35 const _Literal literal = const _Literal();
34 const _MustCallSuper mustCallSuper = const _MustCallSuper(); 36 const _MustCallSuper mustCallSuper = const _MustCallSuper();
35 const _Protected protected = const _Protected(); 37 const _Protected protected = const _Protected();
36 const Required required = const Required(); 38 const Required required = const Required();
37 class Required { 39 class Required {
38 final String reason; 40 final String reason;
39 const Required([this.reason]); 41 const Required([this.reason]);
40 } 42 }
41 43
42 class _Factory { 44 class _Factory {
43 const _Factory(); 45 const _Factory();
44 } 46 }
45 class _Literal { 47 class _Literal {
46 const _Literal(); 48 const _Literal();
47 } 49 }
48 class _MustCallSuper { 50 class _MustCallSuper {
49 const _MustCallSuper(); 51 const _MustCallSuper();
50 } 52 }
51 class _Protected { 53 class _Protected {
52 const _Protected(); 54 const _Protected();
53 } 55 }
54 class _Required { 56 class _Required {
55 final String reason; 57 final String reason;
56 const _Required([this.reason])); 58 const _Required([this.reason]));
57 } 59 }
58 ''', 60 '''
59 'package:js/js.dart': r''' 61 ],
62 [
63 'js',
64 r'''
60 library js; 65 library js;
61 class JS { 66 class JS {
62 const JS([String js]) { } 67 const JS([String js]) { }
63 } 68 }
64 ''' 69 '''
65 }, resourceProvider: resourceProvider); 70 ]
71 ]);
66 } 72 }
67 73
68 test_abstractSuperMemberReference_getter() async { 74 test_abstractSuperMemberReference_getter() async {
69 Source source = addSource(r''' 75 Source source = addSource(r'''
70 abstract class A { 76 abstract class A {
71 int get test; 77 int get test;
72 } 78 }
73 class B extends A { 79 class B extends A {
74 int get test { 80 int get test {
75 super.test; 81 super.test;
(...skipping 3952 matching lines...) Expand 10 before | Expand all | Expand 10 after
4028 n() { 4034 n() {
4029 var a = m(), b = m(); 4035 var a = m(), b = m();
4030 } 4036 }
4031 }'''); 4037 }''');
4032 await computeAnalysisResult(source); 4038 await computeAnalysisResult(source);
4033 assertErrors( 4039 assertErrors(
4034 source, [HintCode.USE_OF_VOID_RESULT, HintCode.USE_OF_VOID_RESULT]); 4040 source, [HintCode.USE_OF_VOID_RESULT, HintCode.USE_OF_VOID_RESULT]);
4035 verify([source]); 4041 verify([source]);
4036 } 4042 }
4037 } 4043 }
4044
4045 @reflectiveTest
4046 class HintCodeTest_Driver extends HintCodeTest {
4047 @override
4048 bool get enableNewAnalysisDriver => true;
4049 }
OLDNEW
« no previous file with comments | « pkg/analyzer/test/generated/error_suppression_test.dart ('k') | pkg/analyzer/test/generated/non_error_resolver_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698