package de.arxsilex.maptools.converter.desktop

import de.arxsilex.maptools.converter.core.PoiSchemaVersion
import java.nio.file.Path
import kotlin.test.Test

class RealMapsforgePoiCompatibilityTest {
    @Test
    fun `optional real poi output has the selected mapsforge schema`() {
        val file = System.getenv("MAPTOOLS_TEST_POI")?.takeIf(String::isNotBlank) ?: return
        val schema = System.getenv("MAPTOOLS_TEST_POI_SCHEMA")
            ?.toIntOrNull()
            ?.let { metadataVersion ->
                PoiSchemaVersion.entries.single { it.metadataVersion == metadataVersion }
            }
            ?: PoiSchemaVersion.V4

        ExportOutputValidator.validateMapsforgePoi(Path.of(file), schema)
    }
}
