Skip to content

Commit db386d3

Browse files
committed
Basic test cases for comments in import statements
1 parent 5f51ad2 commit db386d3

File tree

2 files changed

+41
-0
lines changed

2 files changed

+41
-0
lines changed
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
# ensure trailing comments are preserved
2+
import x # comment
3+
from x import a # comment
4+
from x import a, b # comment
5+
from x import a as b # comment
6+
from x import a as b, b as c # comment
7+
8+
# ensure intermixed end- and own-line comments are all preserved
9+
# and at least kept in their original order, if not their original
10+
# positions within the import statement
11+
from x import ( # alpha
12+
# bravo
13+
a # charlie
14+
# delta
15+
as # echo
16+
# foxtrot
17+
b # golf
18+
# hotel
19+
, # india
20+
# juliet
21+
) # kilo
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
# ensure trailing comments are preserved
2+
import x # comment
3+
from x import a # comment
4+
from x import a, b # comment
5+
from x import a as b # comment
6+
from x import a as b, b as c # comment
7+
8+
# ensure intermixed end- and own-line comments are all preserved
9+
# and at least kept in their original order, if not their original
10+
# positions within the import statement
11+
from x import ( # alpha
12+
# bravo
13+
a as b, # charlie
14+
# delta
15+
# echo
16+
# foxtrot # golf
17+
# hotel
18+
# india
19+
# juliet
20+
) # kilo

0 commit comments

Comments
 (0)