Skip to content

Commit

Permalink
Test cases
Browse files Browse the repository at this point in the history
  • Loading branch information
dhruvmanila committed Jan 24, 2024
1 parent facb6f8 commit 86a5375
Show file tree
Hide file tree
Showing 5 changed files with 226 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
[
{
"source_type": "Stub",
"preview": "enabled"
}
]
Original file line number Diff line number Diff line change
@@ -0,0 +1,174 @@
class Top1:
pass
class Top2:
pass

class Top:
class Ellipsis: ...
class Ellipsis: ...

class Top:
class Ellipsis: ...
class Pass:
pass

class Top:
class Ellipsis: ...
class_variable = 1

class Top:
class TrailingComment:
pass
# comment
class Other:
pass

class Top:
class CommentWithEllipsis: ...
# comment
class Other: ...

class Top:
class TrailingCommentWithMultipleBlankLines:
pass


# comment
class Other:
pass

class Top:
class Nested:
pass

# comment
class LeadingComment:
pass

class Top:
@decorator
class Ellipsis: ...
@decorator
class Ellipsis: ...

class Top:
@decorator
class Ellipsis: ...
@decorator
class Pass:
pass

class Top:
class Foo:
pass




class AfterMultipleEmptyLines:
pass

class Top:
class Nested11:
class Nested12:
pass
class Nested21:
pass

class Top:
class Nested11:
class Nested12:
pass
# comment
class Nested21:
pass

class Top:
class Nested11:
class Nested12:
pass
# comment
class Nested21:
pass
# comment

class Top1:
class Nested:
pass
class Top2:
pass

class Top1:
class Nested:
pass
# comment
class Top2:
pass

class Top1:
class Nested:
pass
# comment
class Top2:
pass

if foo:
class Nested1:
pass
class Nested2:
pass
else:
pass

if foo:
class Nested1:
pass
class Nested2:
pass
# comment
else:
pass

if top1:
class Nested:
pass
if top2:
pass

if top1:
class Nested:
pass
# comment
if top2:
pass

if top1:
class Nested:
pass
# comment
if top2:
pass

try:
class Try:
pass
except:
class Except:
pass
foo = 1

match foo:
case 1:
class Nested:
pass
case 2:
class Nested:
pass
case _:
class Nested:
pass
foo = 1

class Eof:
class Nested:
pass
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
[
{
"source_type": "Stub",
"preview": "enabled"
}
]
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# A separate file to test out the behavior when there are a mix of blank lines
# and comments at EOF just after a nested stub class.

class Top:
class Nested1:
class Nested12:
pass
# comment
class Nested2:
pass



# comment



Original file line number Diff line number Diff line change
Expand Up @@ -309,4 +309,27 @@ class ComplexStatements:
```


## Preview changes
```diff
--- Stable
+++ Preview
@@ -110,6 +110,7 @@
class InnerClass5:
def a(self): ...
+
field1 = 1
class InnerClass6:
@@ -119,6 +120,7 @@
class InnerClass7:
def a(self): ...
+
print("hi")
class InnerClass8:
```



0 comments on commit 86a5375

Please sign in to comment.