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 test.edit.fixes; | 5 library test.edit.fixes; |
6 | 6 |
7 import 'dart:async'; | 7 import 'dart:async'; |
8 | 8 |
9 import 'package:analysis_server/src/edit/edit_domain.dart'; | 9 import 'package:analysis_server/src/edit/edit_domain.dart'; |
10 import 'package:analysis_server/src/protocol.dart'; | 10 import 'package:analysis_server/src/protocol.dart'; |
11 import 'package:unittest/unittest.dart' hide ERROR; | 11 import 'package:unittest/unittest.dart' hide ERROR; |
12 | 12 |
13 import '../analysis_abstract.dart'; | 13 import '../analysis_abstract.dart'; |
14 import '../reflective_tests.dart'; | 14 import '../reflective_tests.dart'; |
15 | 15 |
16 | 16 |
17 main() { | 17 main() { |
18 groupSep = ' | '; | 18 groupSep = ' | '; |
19 runReflectiveTests(FixesTest); | 19 runReflectiveTests(FixesTest); |
20 } | 20 } |
21 | 21 |
22 | 22 |
23 @ReflectiveTestCase() | 23 @reflectiveTest |
24 class FixesTest extends AbstractAnalysisTest { | 24 class FixesTest extends AbstractAnalysisTest { |
25 @override | 25 @override |
26 void setUp() { | 26 void setUp() { |
27 super.setUp(); | 27 super.setUp(); |
28 createProject(); | 28 createProject(); |
29 handler = new EditDomainHandler(server); | 29 handler = new EditDomainHandler(server); |
30 } | 30 } |
31 | 31 |
32 Future test_fixUndefinedClass() { | 32 Future test_fixUndefinedClass() { |
33 addTestFile(''' | 33 addTestFile(''' |
(...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
87 } | 87 } |
88 | 88 |
89 | 89 |
90 void _isSyntacticErrorWithSingleFix(AnalysisErrorFixes fixes) { | 90 void _isSyntacticErrorWithSingleFix(AnalysisErrorFixes fixes) { |
91 AnalysisError error = fixes.error; | 91 AnalysisError error = fixes.error; |
92 expect(error.severity, AnalysisErrorSeverity.ERROR); | 92 expect(error.severity, AnalysisErrorSeverity.ERROR); |
93 expect(error.type, AnalysisErrorType.SYNTACTIC_ERROR); | 93 expect(error.type, AnalysisErrorType.SYNTACTIC_ERROR); |
94 expect(fixes.fixes, hasLength(1)); | 94 expect(fixes.fixes, hasLength(1)); |
95 } | 95 } |
96 } | 96 } |
OLD | NEW |