@@ -17,7 +17,70 @@ func TestWalk(t *testing.T) {
17
17
out []string
18
18
}{
19
19
{nil , []string {}},
20
+
21
+ // An empty one of everything
20
22
{& Module {}, []string {"*ast.Module" }},
23
+ {& Interactive {}, []string {"*ast.Interactive" }},
24
+ {& Expression {}, []string {"*ast.Expression" }},
25
+ {& Suite {}, []string {"*ast.Suite" }},
26
+ {& FunctionDef {}, []string {"*ast.FunctionDef" }},
27
+ {& ClassDef {}, []string {"*ast.ClassDef" }},
28
+ {& Return {}, []string {"*ast.Return" }},
29
+ {& Delete {}, []string {"*ast.Delete" }},
30
+ {& Assign {}, []string {"*ast.Assign" }},
31
+ {& AugAssign {}, []string {"*ast.AugAssign" }},
32
+ {& For {}, []string {"*ast.For" }},
33
+ {& While {}, []string {"*ast.While" }},
34
+ {& If {}, []string {"*ast.If" }},
35
+ {& With {}, []string {"*ast.With" }},
36
+ {& Raise {}, []string {"*ast.Raise" }},
37
+ {& Try {}, []string {"*ast.Try" }},
38
+ {& Assert {}, []string {"*ast.Assert" }},
39
+ {& Import {}, []string {"*ast.Import" }},
40
+ {& ImportFrom {}, []string {"*ast.ImportFrom" }},
41
+ {& Global {}, []string {"*ast.Global" }},
42
+ {& Nonlocal {}, []string {"*ast.Nonlocal" }},
43
+ {& ExprStmt {}, []string {"*ast.ExprStmt" }},
44
+ {& Pass {}, []string {"*ast.Pass" }},
45
+ {& Break {}, []string {"*ast.Break" }},
46
+ {& Continue {}, []string {"*ast.Continue" }},
47
+ {& BoolOp {}, []string {"*ast.BoolOp" }},
48
+ {& BinOp {}, []string {"*ast.BinOp" }},
49
+ {& UnaryOp {}, []string {"*ast.UnaryOp" }},
50
+ {& Lambda {}, []string {"*ast.Lambda" }},
51
+ {& IfExp {}, []string {"*ast.IfExp" }},
52
+ {& Dict {}, []string {"*ast.Dict" }},
53
+ {& Set {}, []string {"*ast.Set" }},
54
+ {& ListComp {}, []string {"*ast.ListComp" }},
55
+ {& SetComp {}, []string {"*ast.SetComp" }},
56
+ {& DictComp {}, []string {"*ast.DictComp" }},
57
+ {& GeneratorExp {}, []string {"*ast.GeneratorExp" }},
58
+ {& Yield {}, []string {"*ast.Yield" }},
59
+ {& YieldFrom {}, []string {"*ast.YieldFrom" }},
60
+ {& Compare {}, []string {"*ast.Compare" }},
61
+ {& Call {}, []string {"*ast.Call" }},
62
+ {& Num {}, []string {"*ast.Num" }},
63
+ {& Str {}, []string {"*ast.Str" }},
64
+ {& Bytes {}, []string {"*ast.Bytes" }},
65
+ {& NameConstant {}, []string {"*ast.NameConstant" }},
66
+ {& Ellipsis {}, []string {"*ast.Ellipsis" }},
67
+ {& Attribute {}, []string {"*ast.Attribute" }},
68
+ {& Subscript {}, []string {"*ast.Subscript" }},
69
+ {& Starred {}, []string {"*ast.Starred" }},
70
+ {& Name {}, []string {"*ast.Name" }},
71
+ {& List {}, []string {"*ast.List" }},
72
+ {& Tuple {}, []string {"*ast.Tuple" }},
73
+ {& Slice {}, []string {"*ast.Slice" }},
74
+ {& ExtSlice {}, []string {"*ast.ExtSlice" }},
75
+ {& Index {}, []string {"*ast.Index" }},
76
+ {& ExceptHandler {}, []string {"*ast.ExceptHandler" }},
77
+ {& Arguments {}, []string {"*ast.Arguments" }},
78
+ {& Arg {}, []string {"*ast.Arg" }},
79
+ {& Keyword {}, []string {"*ast.Keyword" }},
80
+ {& Alias {}, []string {"*ast.Alias" }},
81
+ {& WithItem {}, []string {"*ast.WithItem" }},
82
+
83
+ // Excercise the walk* closures
21
84
{& Module {Body : []Stmt {& Pass {}}}, []string {"*ast.Module" , "*ast.Pass" }},
22
85
{& Module {Body : []Stmt {& Pass {}, & Pass {}}}, []string {"*ast.Module" , "*ast.Pass" , "*ast.Pass" }},
23
86
{& Expression {Body : & Num {}}, []string {"*ast.Expression" , "*ast.Num" }},
0 commit comments