# Path: simplesqlite/_validator.py
# def validate_sqlite_attr_name(name: str) -> None:
#     """
#     :param str name: Name to validate.
#     :raises pathvalidate.ValidationError:
#         - If the ``name`` includes unprintable character(s).
#         - |raises_sqlite_keywords|
#     """
# 
#     if not name:
#         raise ValidationError(["null name"], reason=ErrorReason.NULL_NAME)
# 
#     if __RE_INVALID_CHARS.search(name):
#         raise ValidationError(["unprintable character found"], reason=ErrorReason.INVALID_CHARACTER)
# 
#     name = name.upper()
# 
#     if name in __SQLITE_INVALID_RESERVED_KEYWORDS_ATTR:
#         raise ValidationError(
#             [f"'{name}' is a reserved keyword by sqlite"],
#             reason=ErrorReason.RESERVED_NAME,
#             reusable_name=False,
#         )
# 
#     if name in __SQLITE_VALID_RESERVED_KEYWORDS_ATTR:
#         raise ValidationError(
#             [f"'{name}' is a reserved keyword by sqlite"],
#             reason=ErrorReason.RESERVED_NAME,
#             reusable_name=True,
#         )
# 
# def validate_sqlite_table_name(name: str) -> None:
#     """
#     :param str name: Name to validate.
#     :raises pathvalidate.ValidationError:
#         - If the ``name`` includes unprintable character(s).
#         - |raises_sqlite_keywords|
#     """
# 
#     if not name:
#         raise ValidationError(["null name"], reason=ErrorReason.NULL_NAME)
# 
#     if __RE_INVALID_CHARS.search(name):
#         raise ValidationError(["unprintable character found"], reason=ErrorReason.INVALID_CHARACTER)
# 
#     name = name.upper()
# 
#     if name in __SQLITE_INVALID_RESERVED_KEYWORDS_TABLE:
#         raise ValidationError(
#             [f"'{name}' is a reserved keyword by sqlite"],
#             reason=ErrorReason.RESERVED_NAME,
#             reusable_name=False,
#         )
# 
#     if name in __SQLITE_VALID_RESERVED_KEYWORDS_TABLE:
#         raise ValidationError(
#             [f"'{name}' is a reserved keyword by sqlite"],
#             reason=ErrorReason.RESERVED_NAME,
#             reusable_name=True,
#         )


import string
import pytest
from pathvalidate import unprintable_ascii_chars
from pathvalidate.error import ErrorReason, ValidationError
from simplesqlite._validator import validate_sqlite_attr_name, validate_sqlite_table_name

    @pytest.mark.parametrize(
        ["value"],
        [[f"a{invalid_c}b"] for invalid_c in unprintable_ascii_chars]
        + [[f"テ{invalid_c}！!スト"] for invalid_c in unprintable_ascii_chars],
    )
    def test_exception_invalid_win_char(self, value):
        try:
            validate_sqlite_table_name(value)
        except ValidationError as e:
            assert e.reason == ErrorReason.INVALID_CHARACTER

    @pytest.mark.parametrize(
        ["value", "expected"],
        [[None, ValidationError], ["", ValidationError], [1, TypeError], [True, TypeError]],
    )
    def test_exception_type(self, value, expected):
        with pytest.raises(expected):
            validate_sqlite_attr_name(value)

    @pytest.mark.parametrize(
        ["value"],
        [
            [reserved_keyword]
            for reserved_keyword in VALID_RESERVED_KEYWORDS_ATTR_UPPER
            + VALID_RESERVED_KEYWORDS_ATTR_LOWER
        ],
    )
    def test_exception_reserved_valid(self, value):
        try:

# Path: simplesqlite/_validator.py
# def validate_sqlite_attr_name(name: str) -> None:
#     """
#     :param str name: Name to validate.
#     :raises pathvalidate.ValidationError:
#         - If the ``name`` includes unprintable character(s).
#         - |raises_sqlite_keywords|
#     """
# 
#     if not name:
#         raise ValidationError(["null name"], reason=ErrorReason.NULL_NAME)
# 
#     if __RE_INVALID_CHARS.search(name):
#         raise ValidationError(["unprintable character found"], reason=ErrorReason.INVALID_CHARACTER)
# 
#     name = name.upper()
# 
#     if name in __SQLITE_INVALID_RESERVED_KEYWORDS_ATTR:
#         raise ValidationError(
#             [f"'{name}' is a reserved keyword by sqlite"],
#             reason=ErrorReason.RESERVED_NAME,
#             reusable_name=False,
#         )
# 
#     if name in __SQLITE_VALID_RESERVED_KEYWORDS_ATTR:
#         raise ValidationError(
#             [f"'{name}' is a reserved keyword by sqlite"],
#             reason=ErrorReason.RESERVED_NAME,
#             reusable_name=True,
#         )
# 
# def validate_sqlite_table_name(name: str) -> None:
#     """
#     :param str name: Name to validate.
#     :raises pathvalidate.ValidationError:
#         - If the ``name`` includes unprintable character(s).
#         - |raises_sqlite_keywords|
#     """
# 
#     if not name:
#         raise ValidationError(["null name"], reason=ErrorReason.NULL_NAME)
# 
#     if __RE_INVALID_CHARS.search(name):
#         raise ValidationError(["unprintable character found"], reason=ErrorReason.INVALID_CHARACTER)
# 
#     name = name.upper()
# 
#     if name in __SQLITE_INVALID_RESERVED_KEYWORDS_TABLE:
#         raise ValidationError(
#             [f"'{name}' is a reserved keyword by sqlite"],
#             reason=ErrorReason.RESERVED_NAME,
#             reusable_name=False,
#         )
# 
#     if name in __SQLITE_VALID_RESERVED_KEYWORDS_TABLE:
#         raise ValidationError(
#             [f"'{name}' is a reserved keyword by sqlite"],
#             reason=ErrorReason.RESERVED_NAME,
#             reusable_name=True,
#         )


# Path: test/test_validator.py
import string
import pytest
from pathvalidate import unprintable_ascii_chars
from pathvalidate.error import ErrorReason, ValidationError
from simplesqlite._validator import validate_sqlite_attr_name, validate_sqlite_table_name


    @pytest.mark.parametrize(
        ["value"],
        [[f"a{invalid_c}b"] for invalid_c in unprintable_ascii_chars]
        + [[f"テ{invalid_c}！!スト"] for invalid_c in unprintable_ascii_chars],
    )
    def test_exception_invalid_win_char(self, value):
        try:
            validate_sqlite_table_name(value)
        except ValidationError as e:
            assert e.reason == ErrorReason.INVALID_CHARACTER

    @pytest.mark.parametrize(
        ["value", "expected"],
        [[None, ValidationError], ["", ValidationError], [1, TypeError], [True, TypeError]],
    )
    def test_exception_type(self, value, expected):
        with pytest.raises(expected):
            validate_sqlite_attr_name(value)

    @pytest.mark.parametrize(
        ["value"],
        [
            [reserved_keyword]
            for reserved_keyword in VALID_RESERVED_KEYWORDS_ATTR_UPPER
            + VALID_RESERVED_KEYWORDS_ATTR_LOWER
        ],
    )
    def test_exception_reserved_valid(self, value):
        try:

            validate_sqlite_attr_name(value)