blob: 440b948701b6c53aea40a4e6d05ad3bc16bbbd82 [file] [log] [blame]
// Copyright (c) 2019, 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:analysis_server/src/services/correction/fix_internal.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(UnnecessaryConstTest);
});
}
@reflectiveTest
class UnnecessaryConstTest extends FixProcessorLintTest {
@override
FixKind get kind => DartFixKind.REMOVE_UNNECESSARY_CONST;
@override
String get lintCode => LintNames.unnecessary_const;
test_constConstructor() async {
await resolveTestUnit('''
class A { const A(); }
m(){
const a = /*LINT*/const A();
}
''');
await assertHasFix('''
class A { const A(); }
m(){
const a = /*LINT*/A();
}
''');
}
}