package com.applemand.zmanim.core.jewcal

import com.google.common.truth.Truth.assertThat
import org.junit.Test

class HebrewNumeralsTest {
    @Test fun `single digits`() {
        assertThat(HebrewNumerals.format(1)).isEqualTo("א׳")
        assertThat(HebrewNumerals.format(9)).isEqualTo("ט׳")
    }

    @Test fun `fifteen and sixteen use tikanim`() {
        assertThat(HebrewNumerals.format(15)).isEqualTo("ט״ו")
        assertThat(HebrewNumerals.format(16)).isEqualTo("ט״ז")
    }

    @Test fun `tens combine with ones`() {
        assertThat(HebrewNumerals.format(17)).isEqualTo("י״ז")
        assertThat(HebrewNumerals.format(29)).isEqualTo("כ״ט")
        assertThat(HebrewNumerals.format(30)).isEqualTo("ל׳")
    }

    @Test fun `hundreds combine with tens and ones`() {
        assertThat(HebrewNumerals.format(121)).isEqualTo("קכ״א")
        assertThat(HebrewNumerals.format(500)).isEqualTo("ת״ק")
        assertThat(HebrewNumerals.format(999)).isEqualTo("תתקצ״ט")
    }
}
