Phase 0: strip JetBrains template, register Jai language and file type
- delete demo tool window + message bundle, rewrite plugin.xml metadata - add JaiLanguage, JaiFileType, file icon, JaiTokenTypes (from the compiler's own lexer: modules/Jai_Lexer/module.jai) - add ./jaitest: runs tests and reports the JUnit XML, not just the exit code - ignore .kotlin
This commit is contained in:
25
src/test/kotlin/dev/hgh/jai/JaiFileTypeTest.kt
Normal file
25
src/test/kotlin/dev/hgh/jai/JaiFileTypeTest.kt
Normal file
@@ -0,0 +1,25 @@
|
||||
package dev.hgh.jai
|
||||
|
||||
import com.intellij.openapi.fileTypes.FileTypeManager
|
||||
import com.intellij.testFramework.fixtures.BasePlatformTestCase
|
||||
|
||||
/**
|
||||
* Verifies plugin.xml wiring: the `.jai` extension resolves to our file type and
|
||||
* our language, without launching an IDE.
|
||||
*/
|
||||
class JaiFileTypeTest : BasePlatformTestCase() {
|
||||
fun testJaiExtensionIsRegistered() {
|
||||
val type = FileTypeManager.getInstance().getFileTypeByExtension("jai")
|
||||
assertEquals(JaiFileType, type)
|
||||
}
|
||||
|
||||
/**
|
||||
* The *virtual* file already resolves to our type. The PSI file's language stays
|
||||
* plain text until a ParserDefinition is registered (phase 3) — asserting that here
|
||||
* would be asserting the platform's fallback, not our wiring.
|
||||
*/
|
||||
fun testVirtualFileUsesJaiFileType() {
|
||||
val file = myFixture.configureByText("sample.jai", "main :: () { }")
|
||||
assertEquals(JaiFileType, file.virtualFile.fileType)
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user