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

Unified Diff: pkg/analysis_server/test/services/correction/fix_test.dart

Issue 562183003: Issue 10355. Quick Fix to replace 'var' with 'dynamic'. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 6 years, 3 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « pkg/analysis_server/lib/src/services/correction/fix_internal.dart ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/analysis_server/test/services/correction/fix_test.dart
diff --git a/pkg/analysis_server/test/services/correction/fix_test.dart b/pkg/analysis_server/test/services/correction/fix_test.dart
index fa6530d8495a7c0965a6ac1d1fbf02e952d086e7..996df309af2b081a794fd36131177e78349475be 100644
--- a/pkg/analysis_server/test/services/correction/fix_test.dart
+++ b/pkg/analysis_server/test/services/correction/fix_test.dart
@@ -31,6 +31,8 @@ class FixProcessorTest extends AbstractSingleUnitTest {
Index index;
SearchEngineImpl searchEngine;
+ bool checkHasSingleError = true;
+
Fix fix;
SourceChange change;
String resultCode;
@@ -1248,6 +1250,20 @@ main() {
''');
}
+ void test_replaceVarWithDynamic() {
+ checkHasSingleError = false;
+ _indexTestUnit('''
+class A {
+ Map<String, var> m;
+}
+''');
+ assertHasFix(FixKind.REPLACE_VAR_WITH_DYNAMIC, '''
+class A {
+ Map<String, dynamic> m;
+}
+''');
+ }
+
void test_replaceWithConstInstanceCreation() {
_indexTestUnit('''
class A {
@@ -1811,11 +1827,9 @@ main() {
AnalysisError _findErrorToFix() {
List<AnalysisError> errors = context.computeErrors(testSource);
- expect(
- errors,
- hasLength(1),
- reason: 'Exactly 1 error expected, but ${errors.length} found:\n' +
- errors.join('\n'));
+ if (checkHasSingleError) {
+ expect(errors, hasLength(1));
+ }
return errors[0];
}
« no previous file with comments | « pkg/analysis_server/lib/src/services/correction/fix_internal.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698