-
Notifications
You must be signed in to change notification settings - Fork 1.6k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fixes: #33290 Change-Id: Ice1c11907ed696d9d209145a4cacf2ca250c17c6 Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/115273 Commit-Queue: Phil Quitslund <pquitslund@google.com> Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
- Loading branch information
Showing
4 changed files
with
93 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
55 changes: 55 additions & 0 deletions
55
pkg/analysis_server/test/src/services/correction/fix/make_variable_not_final_test.dart
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
// 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:analyzer_plugin/utilities/fixes/fixes.dart'; | ||
import 'package:test_reflective_loader/test_reflective_loader.dart'; | ||
|
||
import 'fix_processor.dart'; | ||
|
||
main() { | ||
defineReflectiveSuite(() { | ||
defineReflectiveTests(MakeVariableNotFinalTest); | ||
}); | ||
} | ||
|
||
@reflectiveTest | ||
class MakeVariableNotFinalTest extends FixProcessorTest { | ||
@override | ||
FixKind get kind => DartFixKind.MAKE_VARIABLE_NOT_FINAL; | ||
|
||
test_hasType() async { | ||
await resolveTestUnit(''' | ||
main() { | ||
final int fff = 1; | ||
fff = 2; | ||
print(fff); | ||
} | ||
'''); | ||
await assertHasFix(''' | ||
main() { | ||
int fff = 1; | ||
fff = 2; | ||
print(fff); | ||
} | ||
'''); | ||
} | ||
|
||
test_noType() async { | ||
await resolveTestUnit(''' | ||
main() { | ||
final fff = 1; | ||
fff = 2; | ||
print(fff); | ||
} | ||
'''); | ||
await assertHasFix(''' | ||
main() { | ||
var fff = 1; | ||
fff = 2; | ||
print(fff); | ||
} | ||
'''); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters