File tree Expand file tree Collapse file tree 1 file changed +12
-1
lines changed
src/test/kotlin/com/compiler/server/generator Expand file tree Collapse file tree 1 file changed +12
-1
lines changed Original file line number Diff line number Diff line change @@ -6,11 +6,13 @@ import com.compiler.server.base.renderErrorDescriptors
6
6
import com.compiler.server.model.*
7
7
import com.compiler.server.service.KotlinProjectExecutor
8
8
import model.Completion
9
+ import org.jetbrains.kotlin.utils.addToStdlib.assertedCast
9
10
import org.junit.jupiter.api.Assertions
10
11
import org.springframework.beans.factory.annotation.Autowired
11
12
import org.springframework.stereotype.Component
12
13
import java.io.IOException
13
14
import kotlin.io.path.*
15
+ import kotlin.test.assertTrue
14
16
15
17
16
18
@Component
@@ -155,7 +157,16 @@ class TestProjectRunner {
155
157
project : Project ,
156
158
contains : String ,
157
159
): ExecutionResult {
158
- val result = kotlinProjectExecutor.convertToWasm(project) as TranslationWasmResult
160
+ val result = kotlinProjectExecutor.convertToWasm(project)
161
+
162
+ if (result !is TranslationWasmResult ) {
163
+ Assertions .assertFalse(result.hasErrors) {
164
+ " Test contains errors!\n\n " + renderErrorDescriptors(result.errors.filterOnlyErrors)
165
+ }
166
+ }
167
+
168
+ result as TranslationWasmResult
169
+
159
170
Assertions .assertNotNull(result, " Test result should no be a null" )
160
171
161
172
val tmpDir = createTempDirectory()
You can’t perform that action at this time.
0 commit comments