"""Tests for internal utility functions (_utils.py)."""

from walkingpandas._utils import _escape_sql_string, _format_id_list_sql


def test_escape_sql_string_no_quotes():
    assert _escape_sql_string("hello") == "hello"


def test_escape_sql_string_with_quotes():
    assert _escape_sql_string("it's") == "it''s"


def test_format_id_list_sql_empty():
    assert _format_id_list_sql([]) == ""


def test_format_id_list_sql_integers():
    assert _format_id_list_sql([1, 2, 3]) == "1, 2, 3"


def test_format_id_list_sql_strings():
    result = _format_id_list_sql(["Station_A", "Station_B"])
    assert result == "'Station_A', 'Station_B'"


def test_format_id_list_sql_strings_with_quotes():
    result = _format_id_list_sql(["it's", "fine"])
    assert result == "'it''s', 'fine'"


def test_format_id_list_sql_mixed():
    result = _format_id_list_sql([1, "two", 3])
    assert "'1'" in result
    assert "'two'" in result
    assert "'3'" in result
