def test_auto_incremented_register_repr(name, delta): a = Register(name, len(name)) r = repr(AutoIncrementedRegister(a, delta)) assert r.startswith('AutoIncrementedRegister') assert name in r assert str(delta) in r assert check_balanced(r)
def test_label_repr(cls, operand, comment, label_name): assume(is_valid_variable_name(label_name)) label = Label(label_name) r = repr(cls(operand, comment, label)) assert r.startswith(cls.__name__) assert repr(operand) in r assert repr(label) in r assert check_balanced(r)
def test_register_repr(name): r = repr(Register(name, len(name))) assert r.startswith('Register') assert name in r assert str(len(name)) in r assert check_balanced(r)
def test_mnemonic_repr(m): r = repr(Mnemonic(m)) assert r.startswith('Mnemonic') assert m in r assert check_balanced(r)
def test_relative16_repr(offset): r = repr(Relative16(offset)) assert r.startswith('Relative16') assert str(offset) in r assert check_balanced(r)
def test_integers_repr(items): r = repr(Integers(items)) assert r.startswith('Integers') assert check_balanced(r)
def test_indexed_repr(base, offset): r = repr(Indexed(base, offset)) assert r.startswith('Indexed') assert base.name in r assert check_balanced(r)
def test_immediate_repr(a): r = repr(Immediate(a)) assert r.startswith('Immediate') assert str(a) in r assert check_balanced(r)
def test_extended_indirect_repr(address): r = repr(ExtendedIndirect(address)) assert r.startswith('ExtendedIndirect') assert hex(address)[2:].upper() in r assert check_balanced(r)
def test_inherent_repr(): r = repr(Inherent()) assert r.startswith('Inherent') assert check_balanced(r)
def test_page_direct_repr(address): r = repr(PageDirect(address)) assert r.startswith('PageDirect') assert hex(address)[2:].upper() in r assert check_balanced(r)
def test_registers_repr(s): r = repr(Registers(s)) assert r.startswith('Registers') assert all(register.name in r for register in s) assert check_balanced(r)
def test_label_repr(name): assume(is_valid_variable_name(name)) r = repr(Label(name)) assert r.startswith('Label') assert name in r assert check_balanced(r)