blob: 6027ac68d8083eb440b83a57aade35bd4c38aafc [file] [log] [blame]
// Copyright (c) 2018, the Dart project authors. Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
import 'package:analysis_server/src/services/correction/fix.dart';
import 'package:analyzer_plugin/utilities/fixes/fixes.dart';
import 'package:test_reflective_loader/test_reflective_loader.dart';
import 'fix_processor.dart';
main() {
defineReflectiveSuite(() {
defineReflectiveTests(MakeFieldNotFinalTest);
});
}
@reflectiveTest
class MakeFieldNotFinalTest extends FixProcessorTest {
@override
FixKind get kind => DartFixKind.MAKE_FIELD_NOT_FINAL;
test_hasType() async {
await resolveTestUnit('''
class A {
final int fff = 1;
main() {
fff = 2;
}
}
''');
await assertHasFix('''
class A {
int fff = 1;
main() {
fff = 2;
}
}
''');
}
test_noType() async {
await resolveTestUnit('''
class A {
final fff = 1;
main() {
fff = 2;
}
}
''');
await assertHasFix('''
class A {
var fff = 1;
main() {
fff = 2;
}
}
''');
}
}