1
1
mirror of https://github.com/github/semantic.git synced 2024-12-26 08:25:19 +03:00

Add test case

This commit is contained in:
Rick Winfrey 2019-02-08 17:41:16 -08:00
parent 2c5aeebf3e
commit f8645c43b5
6 changed files with 116 additions and 25 deletions

View File

@ -8,3 +8,7 @@ class C():
class B(method1): class B(method1):
def method1(self): def method1(self):
return return
class D(e):
f: str
g: Optional[int]

View File

@ -5,3 +5,7 @@ class D(method1):
class B: class B:
def b(self): def b(self):
return c return c
class E(e):
g: str
h: Optional[int]

View File

@ -1,31 +1,69 @@
(Statements (Statements
(Class {-(Class
{ (Identifier) {-(Identifier)-}
->(Identifier) } {-(Statements
{+(Identifier)+} {-(Function
(Statements {-(Identifier)-}
(Function {-(Identifier)-}
{ (Identifier) {-(Statements
->(Identifier) } {-(Return
(Identifier) {-(Identifier)-})-})-})-})-})-}
(Statements
(Return
{ (Identifier)
->(Empty) })))))
{-(Class {-(Class
{-(Identifier)-} {-(Identifier)-}
{-(Statements {-(Statements
{-(NoOp {-(NoOp
{-(Empty)-})-})-})-} {-(Empty)-})-})-})-}
{-(Class
{-(Identifier)-}
{-(Identifier)-}
{-(Statements
{-(Function
{-(Identifier)-}
{-(Identifier)-}
{-(Statements
{-(Return
{-(Empty)-})-})-})-})-})-}
(Class (Class
(Identifier) (Identifier)
{-(Identifier)-}
(Statements
(Function
{ (Identifier) { (Identifier)
->(Identifier) } ->(Identifier) }
(Identifier)
(Statements (Statements
(Return {+(Function
{ (Empty) {+(Identifier)+}
->(Identifier) })))))) {+(Identifier)+}
{+(Statements
{+(Return
{+(Empty)+})+})+})+}
{-(Assignment
{-(Identifier)-}
{-(Identifier)-}
{-(Empty)-})-}
{-(Assignment
{-(Subscript
{-(Identifier)-}
{-(Identifier)-})-}
{-(Identifier)-}
{-(Empty)-})-}))
{+(Class
{+(Identifier)+}
{+(Statements
{+(Function
{+(Identifier)+}
{+(Identifier)+}
{+(Statements
{+(Return
{+(Identifier)+})+})+})+})+})+}
{+(Class
{+(Identifier)+}
{+(Identifier)+}
{+(Statements
{+(Assignment
{+(Identifier)+}
{+(Identifier)+}
{+(Empty)+})+}
{+(Assignment
{+(Subscript
{+(Identifier)+}
{+(Identifier)+})+}
{+(Identifier)+}
{+(Empty)+})+})+})+})

View File

@ -28,4 +28,21 @@
(Statements (Statements
(Return (Return
{ (Identifier) { (Identifier)
->(Empty) })))))) ->(Empty) })))))
(Class
{ (Identifier)
->(Identifier) }
(Identifier)
(Statements
(Assignment
(Identifier)
{ (Identifier)
->(Identifier) }
(Empty))
(Assignment
(Subscript
(Identifier)
(Identifier))
{ (Identifier)
->(Identifier) }
(Empty)))))

View File

@ -22,4 +22,18 @@
(Identifier) (Identifier)
(Statements (Statements
(Return (Return
(Empty))))))) (Empty))))))
(Class
(Identifier)
(Identifier)
(Statements
(Assignment
(Identifier)
(Identifier)
(Empty))
(Assignment
(Subscript
(Identifier)
(Identifier))
(Identifier)
(Empty)))))

View File

@ -17,4 +17,18 @@
(Identifier) (Identifier)
(Statements (Statements
(Return (Return
(Identifier))))))) (Identifier))))))
(Class
(Identifier)
(Identifier)
(Statements
(Assignment
(Identifier)
(Identifier)
(Empty))
(Assignment
(Subscript
(Identifier)
(Identifier))
(Identifier)
(Empty)))))