package com.marvinelsen.crossstraits.internal

import io.kotest.core.spec.style.ShouldSpec
import io.kotest.matchers.shouldBe
import java.util.zip.GZIPInputStream

class CsvCrossStraitsParserTest : ShouldSpec({
    should("parse all of cross straits correctly") {
        val crossStraitsFilePath = "/cross-straits.csv.gz"
        val crossStraitsFileStream = GZIPInputStream(javaClass.getResourceAsStream(crossStraitsFilePath))

        val crossStraitsParser = CsvCrossStraitsParser()

        crossStraitsFileStream.use {
            val crossStraitsEntries = crossStraitsParser.parse(crossStraitsFileStream)

            crossStraitsEntries.toList().size shouldBe 101_682
        }
    }
})
