# Path: meta_package_manager/version.py
# ALNUM_EXTRACTOR = re.compile("(\\d+ | [a-z]+)", re.VERBOSE)
# class Token:
# class TokenizedString:
#     def __hash__(self):
#     def str_to_int(string):
#     def __init__(self, value):
#     def __repr__(self):
#     def __str__(self):
#     def __int__(self):
#     def isint(self):
#     def _match_type(self, other):
#     def __eq__(self, other):
#     def __ne__(self, other):
#     def __gt__(self, other):
#     def __lt__(self, other):
#     def __ge__(self, other):
#     def __le__(self, other):
#     def __hash__(self):
#     def __new__(cls, value, *args, **kwargs):
#     def __init__(self, value, separator="-"):
#     def __repr__(self):
#     def __str__(self):
#     def pretty_print(self):
#     def tokenize(cls, string):
#     def __iter__(self):
#     def __eq__(self, other):
#     def __ne__(self, other):
#     def __gt__(self, other):
#     def __lt__(self, other):
#     def __ge__(self, other):
#     def __le__(self, other):


from random import shuffle
from ..version import Token, TokenizedString, parse_version
import pytest
compared_gt = (
    ("2.0", "1.0"),
    ("0.1", "0"),
    ("0.1", "0.0"),
    ("0.1", "0.0.0.0.0"),
    # ("0.1", "0.beta2"),
    ("2.0", "1.0"),
    ("2.0", "1"),
    ("3.1.10", "3.1.9"),
    # ("6.2", "6.2.0"),
    # ("9.52", "9d"),
    ("8.2p1_1", "8.2p1"),
    # ("3.7.7", "3.7-beta2_1"),
    # ("2.1.1", "2.1.1-git-23hfb2-foobar"),
    (20200313, 20190801),
    ("2020.03.24", "2019.11.28"),
    # ("14.0.1,7:664493ef4a6946b186ff29eb326336a2",
    #  "14,36:076bab302c7b4508975440c56f6cc26a"),
)


@pytest.mark.parametrize("ver1,ver2", compared_gt)
def test_version_comparison_gt(ver1, ver2):
    assert TokenizedString(ver1) > TokenizedString(ver2)
    assert parse_version(ver1) > parse_version(ver2)


@pytest.mark.parametrize("ver1,ver2", reverse_fixtures(compared_gt))
def test_version_comparison_lt(ver1, ver2):
    assert TokenizedString(ver1) < TokenizedString(ver2)

# Path: meta_package_manager/version.py
# ALNUM_EXTRACTOR = re.compile("(\\d+ | [a-z]+)", re.VERBOSE)
# class Token:
# class TokenizedString:
#     def __hash__(self):
#     def str_to_int(string):
#     def __init__(self, value):
#     def __repr__(self):
#     def __str__(self):
#     def __int__(self):
#     def isint(self):
#     def _match_type(self, other):
#     def __eq__(self, other):
#     def __ne__(self, other):
#     def __gt__(self, other):
#     def __lt__(self, other):
#     def __ge__(self, other):
#     def __le__(self, other):
#     def __hash__(self):
#     def __new__(cls, value, *args, **kwargs):
#     def __init__(self, value, separator="-"):
#     def __repr__(self):
#     def __str__(self):
#     def pretty_print(self):
#     def tokenize(cls, string):
#     def __iter__(self):
#     def __eq__(self, other):
#     def __ne__(self, other):
#     def __gt__(self, other):
#     def __lt__(self, other):
#     def __ge__(self, other):
#     def __le__(self, other):


# Path: meta_package_manager/tests/test_version.py
from random import shuffle
from ..version import Token, TokenizedString, parse_version
import pytest

compared_gt = (
    ("2.0", "1.0"),
    ("0.1", "0"),
    ("0.1", "0.0"),
    ("0.1", "0.0.0.0.0"),
    # ("0.1", "0.beta2"),
    ("2.0", "1.0"),
    ("2.0", "1"),
    ("3.1.10", "3.1.9"),
    # ("6.2", "6.2.0"),
    # ("9.52", "9d"),
    ("8.2p1_1", "8.2p1"),
    # ("3.7.7", "3.7-beta2_1"),
    # ("2.1.1", "2.1.1-git-23hfb2-foobar"),
    (20200313, 20190801),
    ("2020.03.24", "2019.11.28"),
    # ("14.0.1,7:664493ef4a6946b186ff29eb326336a2",
    #  "14,36:076bab302c7b4508975440c56f6cc26a"),
)


@pytest.mark.parametrize("ver1,ver2", compared_gt)
def test_version_comparison_gt(ver1, ver2):
    assert TokenizedString(ver1) > TokenizedString(ver2)
    assert parse_version(ver1) > parse_version(ver2)


@pytest.mark.parametrize("ver1,ver2", reverse_fixtures(compared_gt))
def test_version_comparison_lt(ver1, ver2):
    assert TokenizedString(ver1) < TokenizedString(ver2)

    assert parse_version(ver1) < parse_version(ver2)