Added inspection for unresolved symbols, macros and labels.

This commit is contained in:
2021-08-09 11:26:13 +02:00
parent a3f7ddb4f7
commit 431caf64fd
11 changed files with 124 additions and 10 deletions
@@ -0,0 +1,29 @@
package de.platon42.intellij.plugins.m68k.inspections
import com.intellij.testFramework.fixtures.CodeInsightTestFixture
import de.platon42.intellij.jupiter.MyFixture
import org.junit.jupiter.api.Test
internal class M68kUnresolvedReferenceInspectionTest : AbstractInspectionTest() {
@Test
internal fun shows_warning_on_undefined_symbol_label(@MyFixture myFixture: CodeInsightTestFixture) {
myFixture.enableInspections(M68kUnresolvedReferenceInspection::class.java)
myFixture.configureByText("unresolvedref.asm", " bra foobar")
assertHighlightings(myFixture, 1, "Cannot resolve symbol 'foobar'")
}
@Test
internal fun shows_warning_on_undefined_local_label(@MyFixture myFixture: CodeInsightTestFixture) {
myFixture.enableInspections(M68kUnresolvedReferenceInspection::class.java)
myFixture.configureByText("unresolvedref.asm", " bra .foobar")
assertHighlightings(myFixture, 1, "Cannot resolve local label '.foobar'")
}
@Test
internal fun shows_warning_on_undefined_macro(@MyFixture myFixture: CodeInsightTestFixture) {
myFixture.enableInspections(M68kUnresolvedReferenceInspection::class.java)
myFixture.configureByText("unresolvedref.asm", " foobar")
assertHighlightings(myFixture, 1, "Cannot resolve macro 'foobar'")
}
}