"""Tests para slugify_ascii."""

import sys
import os

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

from slugify_ascii import slugify_ascii


def test_slugify_texto_con_puntuacion():
    """slugify texto con puntuacion"""
    assert slugify_ascii("Calle Mayor, 14") == "calle-mayor-14"


def test_slugify_diacriticos():
    """slugify diacriticos"""
    assert slugify_ascii("Ávila") == "avila"


def test_slugify_cadena_vacia_retorna_default():
    """slugify cadena vacia retorna default"""
    assert slugify_ascii("") == "centro"


def test_slugify_trunca_a_max_len():
    """slugify trunca a max_len"""
    assert slugify_ascii("a" * 100, max_len=10) == "aaaaaaaaaa"


def test_slugify_none_retorna_default():
    assert slugify_ascii(None) == "centro"


def test_slugify_default_custom():
    assert slugify_ascii("---", default="sin-nombre") == "sin-nombre"


def test_slugify_solo_diacriticos_y_puntuacion():
    assert slugify_ascii("ñoño") == "nono"


def test_slugify_numeros():
    assert slugify_ascii("28001 Madrid") == "28001-madrid"
