Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 13 additions & 0 deletions tests/functional/builtins/codegen/test_bitwise.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,19 @@ def test_bitwise_opcodes(typ):
assert "SHR" in opcodes


@pytest.mark.parametrize("typ", ["uint256", "bytes32"])
@pytest.mark.xfail # fails due to bad vyper grammar
def test_not_roundtrip(get_contract, typ):
code = f"""
@external
def round_trip() -> {typ}:
b: {typ} = empty({typ})
return ~~b
"""
c = get_contract(code)
assert c.round_trip() == (0 if typ == "uint256" else b"\00" * 32)


@pytest.mark.parametrize("typ", [typ for typ in ALL_TYPES if typ not in ["uint256", "bytes32"]])
@pytest.mark.parametrize("shift_op", ["<<", ">>"])
def test_invalid_shift(typ, shift_op):
Expand Down
Loading