@@ -2,22 +2,25 @@ package cc.unitmesh.devti.language.compiler
2
2
3
3
import cc.unitmesh.devti.language.psi.DevInFile
4
4
import com.intellij.testFramework.fixtures.LightJavaCodeInsightFixtureTestCase
5
+ import org.intellij.lang.annotations.Language
5
6
import org.jetbrains.kotlin.konan.file.File
6
7
7
8
class DevInCompilerTest : LightJavaCodeInsightFixtureTestCase () {
8
9
fun testNormalString () {
9
- val code = " Normal String /"
10
+ @Language(" DevIn" )
11
+ val code = " Normal String"
10
12
val file = myFixture.configureByText(" test.devin" , code)
11
13
12
14
val compile = DevInsCompiler (project, file as DevInFile , myFixture.editor).compile()
13
15
assertEquals(" Normal String /" , compile.output)
14
16
}
15
17
16
18
fun testForWriting () {
17
- // add fake code to project
18
19
val projectPath = project.basePath + File .separator
19
- myFixture.configureByText(" Sample.devin" , " Sample Text" )
20
+
21
+ @Language(" DevIn" )
20
22
val code = " /write:${projectPath} Sample.devin#L1-L2\n ```devin\n Normal String /\n ```"
23
+ myFixture.configureByText(" Sample.devin" , " Sample Text" )
21
24
val file = myFixture.configureByText(" test.devin" , code)
22
25
23
26
try {
@@ -29,6 +32,7 @@ class DevInCompilerTest : LightJavaCodeInsightFixtureTestCase() {
29
32
}
30
33
31
34
fun testForRefactoring () {
35
+ @Language(" DevIn" )
32
36
val code = " /refactor:rename cc.unitmesh.devti.language.run.DevInsProgramRunner to cc.unitmesh.devti.language.run.DevInsProgramRunnerImpl"
33
37
val file = myFixture.configureByText(" test.devin" , code)
34
38
0 commit comments