import pathlib

current = pathlib.Path(__file__).parent
root = current.parent

import sys
sys.path.append(str(root))

import assets

def dump(content: str, validator: type) -> None:
    result = "valid" if validator(content).result else "invalid"

    if len(content) > 20:
        content = content[:17] + "..."

    print("Check validator on \"" + content + "\", result: " + result)

dump("Name", assets.name_validator)
dump("X game", assets.name_validator)
dump(" Invaluid name", assets.name_validator)
dump(" ", assets.name_validator)
dump("", assets.description_validator)
dump("UwU" * 200, assets.description_validator)
dump(" x", assets.description_validator)
dump("UwU", assets.barcode_validator)
dump("12345678", assets.barcode_validator)
dump("12121212121", assets.barcode_validator)
dump("121212121212", assets.barcode_validator)
dump("1212121212123", assets.barcode_validator)