"""Regression tests for pypa/packaging Math-Interpreter#1: ⚡️ Speed up method `Lexer.generate_number` by 11%

Generated by Breakwater. Each test passed on the base commit and failed on the head commit when
generated; it pins the old behaviour.
"""


def test_math_interpreter_1_p2_outcome_0():
    """Breakwater P2: base behaviour pinned (found by differential testing; label: likely-bug)."""
    import pytest
    from lexer import Lexer
    with pytest.raises(Exception) as excinfo:
        result = Lexer('1١').generate_tokens()
        if hasattr(result, '__next__'):  # generators run when iterated
            list(result)
    assert type(excinfo.value) is Exception  # exact type: a subclass would be a behaviour change


def test_math_interpreter_1_p2_outcome_1():
    """Breakwater P2: base behaviour pinned (found by differential testing; label: needs-human)."""
    import pytest
    from lexer import Lexer
    with pytest.raises(Exception) as excinfo:
        result = Lexer('1' + '0' * 4299 + '١').generate_tokens()
        if hasattr(result, '__next__'):  # generators run when iterated
            list(result)
    assert type(excinfo.value) is Exception  # exact type: a subclass would be a behaviour change


def test_math_interpreter_1_p2_outcome_2():
    """Breakwater P2: base behaviour pinned (found by differential testing; label: likely-bug)."""
    import pytest
    from lexer import Lexer
    with pytest.raises(Exception) as excinfo:
        result = Lexer('1١ ').generate_tokens()
        if hasattr(result, '__next__'):  # generators run when iterated
            list(result)
    assert type(excinfo.value) is Exception  # exact type: a subclass would be a behaviour change
