@@ -33,7 +33,7 @@ import org.jacodb.ets.dto.EtsFileDto
33
33
import org.jacodb.ets.dto.convertToEtsFile
34
34
import org.jacodb.ets.model.EtsFile
35
35
import org.jacodb.ets.model.EtsScene
36
- import org.junit.jupiter.api.Disabled
36
+ import org.jacodb.ets.utils.loadEtsFileAutoConvert
37
37
import org.junit.jupiter.api.Test
38
38
import org.junit.jupiter.api.TestFactory
39
39
import org.junit.jupiter.api.condition.EnabledIf
@@ -46,7 +46,6 @@ import org.usvm.dataflow.ts.infer.TypeInferenceResult
46
46
import org.usvm.dataflow.ts.infer.annotation.EtsTypeAnnotator
47
47
import org.usvm.dataflow.ts.infer.createApplicationGraph
48
48
import org.usvm.dataflow.ts.infer.dto.toType
49
- import org.usvm.dataflow.ts.loadEtsFileFromResource
50
49
import org.usvm.dataflow.ts.loadEtsProjectFromResources
51
50
import org.usvm.dataflow.ts.testFactory
52
51
import org.usvm.dataflow.ts.util.EtsTraits
@@ -66,14 +65,14 @@ class EtsTypeInferenceTest {
66
65
67
66
companion object {
68
67
private fun load (path : String ): EtsFile {
69
- return loadEtsFileFromResource( " / $ path" )
68
+ return loadEtsFileAutoConvert(getResourcePath( path) )
70
69
}
71
70
}
72
71
73
72
@Test
74
73
fun `type inference for microphone` () {
75
74
val name = " microphone"
76
- val file = load(" ir/ $name .ts.json " )
75
+ val file = load(" /ts/ $name .ts" )
77
76
val project = EtsScene (listOf (file))
78
77
val graph = createApplicationGraph(project)
79
78
@@ -112,7 +111,7 @@ class EtsTypeInferenceTest {
112
111
@Test
113
112
fun `type inference for types` () {
114
113
val name = " types"
115
- val file = load(" ir/ $name .ts.json " )
114
+ val file = load(" /ts/ $name .ts" )
116
115
val project = EtsScene (listOf (file))
117
116
val graph = createApplicationGraph(project)
118
117
@@ -131,7 +130,7 @@ class EtsTypeInferenceTest {
131
130
@Test
132
131
fun `type inference for data` () {
133
132
val name = " data"
134
- val file = load(" ir/ $name .ts.json " )
133
+ val file = load(" /ts/ $name .ts" )
135
134
val project = EtsScene (listOf (file))
136
135
val graph = createApplicationGraph(project)
137
136
@@ -150,7 +149,7 @@ class EtsTypeInferenceTest {
150
149
@Test
151
150
fun `type inference for call` () {
152
151
val name = " call"
153
- val file = load(" ir/ $name .ts.json " )
152
+ val file = load(" /ts/ $name .ts" )
154
153
val project = EtsScene (listOf (file))
155
154
val graph = createApplicationGraph(project)
156
155
@@ -169,27 +168,7 @@ class EtsTypeInferenceTest {
169
168
@Test
170
169
fun `type inference for nested_init` () {
171
170
val name = " nested_init"
172
- val file = load(" ir/$name .ts.json" )
173
- val project = EtsScene (listOf (file))
174
- val graph = createApplicationGraph(project)
175
-
176
- val entrypoints = project.projectClasses
177
- .flatMap { it.methods }
178
- .filter { it.name.startsWith(" entrypoint" ) }
179
- println (" entrypoints: (${entrypoints.size} )" )
180
- entrypoints.forEach {
181
- println (" ${it.signature.enclosingClass.name} ::${it.name} " )
182
- }
183
-
184
- val manager = TypeInferenceManager (EtsTraits (), graph)
185
- manager.analyze(entrypoints)
186
- }
187
-
188
- @Disabled(" EtsIR-ABC is outdated" )
189
- @Test
190
- fun `type inference for cast ABC` () {
191
- val name = " cast"
192
- val file = load(" abcir/$name .abc.json" )
171
+ val file = load(" /ts/$name .ts" )
193
172
val project = EtsScene (listOf (file))
194
173
val graph = createApplicationGraph(project)
195
174
@@ -314,7 +293,7 @@ class EtsTypeInferenceTest {
314
293
@Test
315
294
fun `test if guesser does anything` () {
316
295
val name = " testcases"
317
- val file = load(" ir/ $name .ts.json " )
296
+ val file = load(" /ts/ $name .ts" )
318
297
val project = EtsScene (listOf (file))
319
298
val graph = createApplicationGraph(project)
320
299
@@ -347,7 +326,7 @@ class EtsTypeInferenceTest {
347
326
348
327
@TestFactory
349
328
fun `type inference on testcases` () = testFactory {
350
- val file = load(" ir/ testcases.ts.json " )
329
+ val file = load(" /ts/ testcases.ts" )
351
330
val project = EtsScene (listOf (file))
352
331
val graph = createApplicationGraph(project)
353
332
0 commit comments