-
Notifications
You must be signed in to change notification settings - Fork 7
/
Copy pathtest_new_ast.py
167 lines (114 loc) · 3.96 KB
/
test_new_ast.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
import os
import unittest
import java_sk.main
import java_sk.util
from . import TestCommon
pwd = os.path.dirname(__file__)
tests = os.path.join(pwd, "new_ast")
class TestJava(TestCommon):
def __test(self, fs):
_fs = map(lambda f: os.path.join(tests, f), fs)
ret = java_sk.main.main(_fs, '30')
self.assertEqual(ret, 0)
def test_Args(self):
self.__test(["Args.java"])
def test_Array(self):
self.__test(["Array.java"])
def test_BinExprArgs(self):
self.__test(["BinExprArgs.java"])
def test_BoolArg(self):
self.__test(["BoolArg.java"])
def test_BooMoo(self):
self.__test(["BooMoo.java"])
def test_Calls(self):
self.__test(["Calls.java"])
def test_CallTypes(self):
self.__test(["CallTypes.java"])
def test_Cast(self):
self.__test(["Cast.java"])
def test_ClassField(self):
self.__test(["ClassField.java"])
def test_Construct(self):
self.__test(["Construct.java"])
def test_Creation(self):
self.__test(["Creation.java"])
def test_DifferentTypeVars(self):
self.__test(["DifferentTypeVars.java"])
def test_Fields(self):
self.__test(["Fields.java"])
def test_FieldFromImport(self):
self.__test(["FieldFromImport.java"])
def test_FieldGenericArg(self):
self.__test(["FieldGenericArg.java"])
def test_FieldMethod(self):
self.__test(["FieldMethod.java"])
def test_GenAsArg(self):
self.__test(["GenAsArg.java"])
def test_Generators(self):
self.__test(["Generators.java"])
def test_Hole(self):
self.__test(["Hole.java"])
# TODO: boxing/unboxing??
# def test_IdentifyLoose(self):
# self.__test(["IdentifyLoose.java"])
def test_IdentifyStrict(self):
self.__test(["IdentifyStrict.java"])
def test_Iface(self):
self.__test(["Iface.java"])
def test_IfaceTypes(self):
self.__test(["IfaceTypes.java"])
def test_Iter(self):
self.__test(["Iter.java"])
def test_LocalStaticCalls(self):
self.__test(["LocalStaticCalls.java"])
def test_MethodcallScope(self):
self.__test(["MethodcallScope.java"])
def test_MultiField(self):
self.__test(["MultiField.java"])
def test_NestedClasses(self):
self.__test(["NestedCls.java"])
def test_NestedClasses(self):
self.__test(["NestedClasses.java"])
def test_NonLocalCalls(self):
self.__test(["NonLocalCalls.java"])
# def test_Override(self):
# self.__test(["Override.java"])
def test_PolymorphicFunctions(self):
self.__test(["PolymorphicFunctions.java"])
# not ready for this yet.
# def test_PolyStuff(self):
# self.__test(["PolyStuff.java"])
def test_ReturnTypeParam(self):
self.__test(["ReturnTypeParam.java"])
def test_SimpleArray(self):
self.__test(["SimpleArray.java"])
def test_StaticCalls(self):
self.__test(["StaticCalls.java"])
def test_Static(self):
self.__test(["Static.java"])
def test_StaticVars(self):
self.__test(["StaticVars.java"])
def test_Subclass(self):
self.__test(["Subclass.java"])
def test_SubclassParamCalls(self):
self.__test(["SubclassParamCalls.java"])
def test_SuperCalls(self):
self.__test(["SuperCalls.java"])
def test_Super(self):
self.__test(["Super.java"])
def test_Switch(self):
self.__test(["Switch.java"])
def test_This(self):
self.__test(["This.java"])
def test_ThisCalls(self):
self.__test(["ThisCalls.java"])
def test_ThisConstructor(self):
self.__test(["ThisConstructor.java"])
def test_ThisGenerator(self):
self.__test(["ThisGenerator.java"])
def test_TypeParameters(self):
self.__test(["TypeParameters.java"])
def test_UninterpretedClass(self):
self.__test(["UninterpretedClass.java"])
if __name__ == '__main__':
unittest.main()