package com.marvinelsen.moedict.internal

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

class JsonMoedictParserTest : ShouldSpec({
    should("parse all of moedict correctly") {
        val moedictFilePath = "/moedict.json.gz"
        val moedictFileStream = GZIPInputStream(javaClass.getResourceAsStream(moedictFilePath))

        val moedictParser = JsonMoedictParser()

        moedictFileStream.use {
            val moedictEntries = moedictParser.parse(moedictFileStream)

            moedictEntries.toList().size shouldBe 163_087
        }
    }
})
