Skip to content

Commit

Permalink
add test
Browse files Browse the repository at this point in the history
  • Loading branch information
charles-cooper committed Apr 14, 2024
1 parent 79b1439 commit 001e7dd
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions tests/functional/codegen/types/numbers/test_exponents.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,16 @@ def f0():
compile_code(code)


def test_fold_nonliteral(get_contract):
# test we can fold non-literal constants
code = """
N: constant(uint256) = 3
N2: public(constant(uint256)) = N**N
"""
c = get_contract(code)
assert c.N2() == 3**3


@pytest.mark.fuzzing
@pytest.mark.parametrize("power", range(2, 255))
def test_exp_uint256(get_contract, tx_failed, power):
Expand Down

0 comments on commit 001e7dd

Please sign in to comment.