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

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

Issue 1843763002: Fix for sorting directives with documentation comments. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Keep the documentation comment of the first directive before sorting attached to the first directiv… Created 4 years, 9 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 bcc9c0c1a980a23a52afde02064f37d3b4c43f43..d3f6950d821b8db4b56c74b5e291168a8560f214 100644
--- a/pkg/analysis_server/test/services/correction/sort_members_test.dart
+++ b/pkg/analysis_server/test/services/correction/sort_members_test.dart
@@ -371,34 +371,119 @@ main() {
''');
}
- void test_directives_comments() {
+ void test_directives_docComment_hasLibrary_lines() {
_parseTestUnit(r'''
-// header
-library lib;
+/// Library documentation comment A.
+/// Library documentation comment B.
+library foo.bar;
-import 'c.dart';// c
-import 'a.dart';// aa
-import 'b.dart';// bbb
+/// bbb1
+/// bbb2
+/// bbb3
+import 'b.dart';
+/// aaa1
+/// aaa2
+import 'a.dart';
+''');
+ // validate change
+ _assertSort(r'''
+/// Library documentation comment A.
+/// Library documentation comment B.
+library foo.bar;
-/** doc */
-main() {
-}
+/// aaa1
+/// aaa2
+import 'a.dart';
+/// bbb1
+/// bbb2
+/// bbb3
+import 'b.dart';
+''');
+ }
+
+ void test_directives_docComment_hasLibrary_stars() {
+ _parseTestUnit(r'''
+/**
+ * Library documentation comment A.
+ * Library documentation comment B.
+ */
+library foo.bar;
+
+/**
+ * bbb
+ */
+import 'b.dart';
+/**
+ * aaa
+ * aaa
+ */
+import 'a.dart';
''');
// validate change
_assertSort(r'''
-// header
-library lib;
+/**
+ * Library documentation comment A.
+ * Library documentation comment B.
+ */
+library foo.bar;
+
+/**
+ * aaa
+ * aaa
+ */
+import 'a.dart';
+/**
+ * bbb
+ */
+import 'b.dart';
+''');
+ }
+ void test_directives_docComment_noLibrary_lines() {
+ _parseTestUnit(r'''
+/// Library documentation comment A
+/// Library documentation comment B
+import 'b.dart';
+/// aaa1
+/// aaa2
+import 'a.dart';
+''');
+ // validate change
+ _assertSort(r'''
+/// aaa1
+/// aaa2
+/// Library documentation comment A
+/// Library documentation comment B
import 'a.dart';
import 'b.dart';
-import 'c.dart';
-// c
-// aa
-// bbb
+''');
+ }
-/** doc */
-main() {
-}
+ void test_directives_docComment_noLibrary_stars() {
+ _parseTestUnit(r'''
+/**
+ * Library documentation comment A.
+ * Library documentation comment B.
+ */
+import 'b.dart';
+/**
+ * aaa
+ * aaa
+ */
+import 'a.dart';
+''');
+ // validate change
+ _assertSort(r'''
+/**
+ * aaa
+ * aaa
+ */
+/**
+ * Library documentation comment A.
+ * Library documentation comment B.
+ */
+import 'a.dart';
+import 'b.dart';
''');
}
« 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