"""Boundary tests for natural Korean nutrition onboarding answers."""

from __future__ import annotations

import pytest

from gateway.platforms.telegram_nutrition_onboarding_copy import parse_answer


@pytest.mark.parametrize(
    ("field", "text", "expected"),
    (
        ("height_cm", "180cm", 180.0),
        ("height_cm", "180 cm", 180.0),
        ("weight_kg", "80kg", 80.0),
        ("target_weight_kg", "75 kg", 75.0),
        ("meal_count", "4끼", 4),
        ("meal_count", "하루 4끼", 4),
        ("meal_count", "네 끼", 4),
    ),
)
def test_parse_answer_normalizes_bounded_korean_scalar_forms(
    field: str,
    text: str,
    expected: object,
) -> None:
    assert parse_answer(field, text) == expected


def test_parse_answer_rejects_ambiguous_meal_count() -> None:
    with pytest.raises(ValueError):
        parse_answer("meal_count", "대충 네다섯 끼")
