Index: packages/dart_style/test/splitting/imports.unit |
diff --git a/packages/dart_style/test/splitting/imports.unit b/packages/dart_style/test/splitting/imports.unit |
new file mode 100644 |
index 0000000000000000000000000000000000000000..64a379ae7a7132d5cedb7909b25407b3eead65c1 |
--- /dev/null |
+++ b/packages/dart_style/test/splitting/imports.unit |
@@ -0,0 +1,123 @@ |
+40 columns | |
+>>> does not wrap long import string (#16366) |
+import 'package:some/very/long/import/path.dart'; |
+<<< |
+import 'package:some/very/long/import/path.dart'; |
+>>> wrap import at as |
+import 'package:some/very/long/import/path.dart' as path; |
+<<< |
+import 'package:some/very/long/import/path.dart' |
+ as path; |
+>>> split before deferred |
+import 'package:some/very/long/import/path.dart' deferred as path; |
+<<< |
+import 'package:some/very/long/import/path.dart' |
+ deferred as path; |
+>>> import keeps shows on one line |
+import 'foo.dart'show Ape,Bear,Cat; |
+<<< |
+import 'foo.dart' show Ape, Bear, Cat; |
+>>> import moves all shows to next line |
+import 'foo.dart'show Ape,Bear,Cat,Dog; |
+<<< |
+import 'foo.dart' |
+ show Ape, Bear, Cat, Dog; |
+>>> import moves all shows each to their own line |
+import 'foo.dart'show Ape,Bear,Cat,Dog,Echidna,FlyingFox,Gorilla; |
+<<< |
+import 'foo.dart' |
+ show |
+ Ape, |
+ Bear, |
+ Cat, |
+ Dog, |
+ Echidna, |
+ FlyingFox, |
+ Gorilla; |
+>>> import keeps hides on one line |
+import 'foo.dart'hide Ape,Bear,Cat; |
+<<< |
+import 'foo.dart' hide Ape, Bear, Cat; |
+>>> import moves hides to next line |
+import 'foo.dart'hide Ape,Bear,Cat,Dog; |
+<<< |
+import 'foo.dart' |
+ hide Ape, Bear, Cat, Dog; |
+>>> import moves hides each to their own line |
+import 'foo.dart'hide Ape,Bear,Cat,Dog,Echidna,FlyingFox,Gorilla; |
+<<< |
+import 'foo.dart' |
+ hide |
+ Ape, |
+ Bear, |
+ Cat, |
+ Dog, |
+ Echidna, |
+ FlyingFox, |
+ Gorilla; |
+>>> single line both |
+import 'foo.dart'hide Ape show Bear; |
+<<< |
+import 'foo.dart' hide Ape show Bear; |
+>>> multiline first |
+import 'foo.dart'hide Ape,Bear,Cat,Dog, Echidna, FlyingFox show Ape,Bear,Cat,Dog; |
+<<< |
+import 'foo.dart' |
+ hide |
+ Ape, |
+ Bear, |
+ Cat, |
+ Dog, |
+ Echidna, |
+ FlyingFox |
+ show Ape, Bear, Cat, Dog; |
+>>> multiline second |
+import 'foo.dart'hide Ape,Bear,Cat,Dog show Ape,Bear,Cat,Dog, Echidna, FlyingFox; |
+<<< |
+import 'foo.dart' |
+ hide Ape, Bear, Cat, Dog |
+ show |
+ Ape, |
+ Bear, |
+ Cat, |
+ Dog, |
+ Echidna, |
+ FlyingFox; |
+>>> multiline both |
+import 'foo.dart'hide Ape,Bear,Cat,Dog, Echidna, FlyingFox show Ape,Bear,Cat,Dog, Echidna, FlyingFox; |
+<<< |
+import 'foo.dart' |
+ hide |
+ Ape, |
+ Bear, |
+ Cat, |
+ Dog, |
+ Echidna, |
+ FlyingFox |
+ show |
+ Ape, |
+ Bear, |
+ Cat, |
+ Dog, |
+ Echidna, |
+ FlyingFox; |
+>>> double line both |
+import 'foo.dart'hide Ape,Bear,Cat,Dog show Ape,Bear,Cat,Dog; |
+<<< |
+import 'foo.dart' |
+ hide Ape, Bear, Cat, Dog |
+ show Ape, Bear, Cat, Dog; |
+>>> force both keywords to split even if first would fit on first line |
+import 'foo.dart' hide Ape, Bear show Ape, Bear, Cat, Dog; |
+<<< |
+import 'foo.dart' |
+ hide Ape, Bear |
+ show Ape, Bear, Cat, Dog; |
+>>> force split in list |
+import 'foo.dart' hide First, // |
+Second; |
+<<< |
+import 'foo.dart' |
+ hide |
+ First, // |
+ Second; |