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

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

Issue 1306083003: Sort top-level constants before other top-level variables. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 5 years, 4 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/sort_members.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/sort_members_test.dart
diff --git a/pkg/analysis_server/test/services/correction/sort_members_test.dart b/pkg/analysis_server/test/services/correction/sort_members_test.dart
index 48ecbffcd11fb63399d022eb4a659aeed60b27a4..f0accb645c8fb8af7e8f7d282bfedd72c9fb55e0 100644
--- a/pkg/analysis_server/test/services/correction/sort_members_test.dart
+++ b/pkg/analysis_server/test/services/correction/sort_members_test.dart
@@ -675,6 +675,24 @@ int c;
''');
}
+ void test_unitMembers_topLevelVariable_withConst() {
+ _parseTestUnit(r'''
+int c;
+int a;
+const B = 2;
+int b;
+const A = 1;
+''');
+ // validate change
+ _assertSort(r'''
+const A = 1;
+const B = 2;
+int a;
+int b;
+int c;
+''');
+ }
+
void _assertSort(String expectedCode) {
MemberSorter sorter = new MemberSorter(testCode, testUnit);
List<SourceEdit> edits = sorter.sort();
« no previous file with comments | « pkg/analysis_server/lib/src/services/correction/sort_members.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698