"""Tests para normalize_for_join."""

import sys
import os

sys.path.insert(0, os.path.join(os.path.dirname(__file__), ".."))

from normalize_for_join import normalize_for_join


def test_normalize_con_puntuacion_y_diacriticos_y_none():
    """normalize con puntuacion y diacriticos y None"""
    result = normalize_for_join(["Calle Mayor, 14", "ávila", None])
    assert result == ["CALLE MAYOR 14", "AVILA", ""]


def test_normalize_lista_vacia():
    assert normalize_for_join([]) == []


def test_normalize_upper():
    assert normalize_for_join(["madrid"]) == ["MADRID"]


def test_normalize_elimina_simbolos():
    assert normalize_for_join(["José García S.L."]) == ["JOSE GARCIA SL"]


def test_normalize_colapsa_espacios():
    assert normalize_for_join(["  hola   mundo  "]) == ["HOLA MUNDO"]


def test_normalize_nan_as_empty():
    # NaN de float (float('nan'))
    result = normalize_for_join([float("nan")])
    assert result == [""]


def test_normalize_entero():
    # Enteros se convierten a string
    result = normalize_for_join([28001])
    assert result == ["28001"]
