package com.nisemoe.nise

import com.nisemoe.nise.konata.Replay
import com.nisemoe.nise.konata.compareReplayPair
import org.junit.jupiter.api.Test
import kotlin.test.assertEquals

class CorrelationTest {

    @Test
    fun correlationNoModTest() {

        val replay1String =
            "[encoded data, 44864 characters]"
        val replay2String =
            "[encoded data, 61680 characters]"

        val replay1 = Replay(replay1String, 2895889075, mods = 0)
        val replay2 = Replay(replay2String, 2835156807, mods = 0)

        val result = compareReplayPair(replay1, replay2)

        // konata returned 62.18258527463182
        assertEquals(0.9758306458775717, result.correlation, 0.1)
    }

}