Sort static_type_analyzer_test.dart
Change-Id: I4767ea98e947279d1af5d4295d1c8e66c02dee80
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/96660
Auto-Submit: Paul Berry <paulberry@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
diff --git a/pkg/analyzer/test/generated/static_type_analyzer_test.dart b/pkg/analyzer/test/generated/static_type_analyzer_test.dart
index 4ea099f..839c469 100644
--- a/pkg/analyzer/test/generated/static_type_analyzer_test.dart
+++ b/pkg/analyzer/test/generated/static_type_analyzer_test.dart
@@ -1692,6 +1692,9 @@
class StaticTypeAnalyzerWithStrictInferenceTest
extends StaticTypeAnalyzer2TestShared {
@override
+ bool get enableNewAnalysisDriver => true;
+
+ @override
void setUp() {
super.setUp();
AnalysisOptionsImpl options = new AnalysisOptionsImpl();
@@ -1699,37 +1702,6 @@
resetWith(options: options);
}
- @override
- bool get enableNewAnalysisDriver => true;
-
- test_topLevelVariable() async {
- String code = r'''
-var a;
-''';
- await resolveTestUnit(code, noErrors: false);
- await assertErrorsInCode(
- code, [HintCode.INFERENCE_FAILURE_ON_UNINITIALIZED_VARIABLE]);
- }
-
- test_topLevelVariable_withType() async {
- String code = r'''
-int a;
-dynamic b;
-Object c;
-Null d;
-''';
- await resolveTestUnit(code, noErrors: false);
- await assertNoErrorsInCode(code);
- }
-
- test_topLevelVariable_withInitializer() async {
- String code = r'''
-var a = 7;
-''';
- await resolveTestUnit(code, noErrors: false);
- await assertNoErrorsInCode(code);
- }
-
test_localVariable() async {
String code = r'''
f() {
@@ -1741,6 +1713,16 @@
code, [HintCode.INFERENCE_FAILURE_ON_UNINITIALIZED_VARIABLE]);
}
+ test_localVariable_withInitializer() async {
+ String code = r'''
+f() {
+ var a = 7;
+}
+''';
+ await resolveTestUnit(code, noErrors: false);
+ await assertNoErrorsInCode(code);
+ }
+
test_localVariable_withType() async {
String code = r'''
f() {
@@ -1754,11 +1736,29 @@
await assertNoErrorsInCode(code);
}
- test_localVariable_withInitializer() async {
+ test_topLevelVariable() async {
String code = r'''
-f() {
- var a = 7;
-}
+var a;
+''';
+ await resolveTestUnit(code, noErrors: false);
+ await assertErrorsInCode(
+ code, [HintCode.INFERENCE_FAILURE_ON_UNINITIALIZED_VARIABLE]);
+ }
+
+ test_topLevelVariable_withInitializer() async {
+ String code = r'''
+var a = 7;
+''';
+ await resolveTestUnit(code, noErrors: false);
+ await assertNoErrorsInCode(code);
+ }
+
+ test_topLevelVariable_withType() async {
+ String code = r'''
+int a;
+dynamic b;
+Object c;
+Null d;
''';
await resolveTestUnit(code, noErrors: false);
await assertNoErrorsInCode(code);