package com.correx.core.events.events

import kotlin.test.Test
import kotlin.test.assertFalse
import kotlin.test.assertTrue

class LspDiagnosticTest {
    private fun diagnostic(tags: List<String>) = LspDiagnostic(
        path = "src/App.tsx",
        line = 0,
        character = 0,
        severity = "error",
        code = "6133",
        message = "'React' is declared but its value is never read.",
        tags = tags,
    )

    @Test
    fun `tagged diagnostic is lint class even at error severity`() {
        assertTrue(diagnostic(listOf("unnecessary")).isLint)
        assertTrue(diagnostic(listOf("deprecated")).isLint)
    }

    @Test
    fun `untagged diagnostic still gates`() {
        assertFalse(diagnostic(emptyList()).isLint)
    }
}
