Skip to content

Commit

Permalink
improve tests
Browse files Browse the repository at this point in the history
  • Loading branch information
tserg committed Dec 27, 2023
1 parent 1f9be95 commit 81d1bfb
Show file tree
Hide file tree
Showing 9 changed files with 31 additions and 0 deletions.
4 changes: 4 additions & 0 deletions tests/functional/syntax/test_abs.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,10 @@ def test_abs_fail(assert_compile_failed, get_contract_with_gas_estimation, bad_c
"""
FOO: constant(int256) = -3
BAR: constant(int256) = abs(FOO)
@external
def foo():
a: int256 = BAR
"""
]

Expand Down
4 changes: 4 additions & 0 deletions tests/functional/syntax/test_as_wei_value.py
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,10 @@ def foo() -> uint256:
"""
y: constant(String[5]) = "szabo"
x: constant(uint256) = as_wei_value(5, y)
@external
def foo():
a: uint256 = x
""",
]

Expand Down
1 change: 1 addition & 0 deletions tests/functional/syntax/test_ceil.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
"""
BAR: constant(decimal) = 2.5
FOO: constant(int256) = ceil(BAR)
@external
def foo():
a: int256 = FOO
Expand Down
1 change: 1 addition & 0 deletions tests/functional/syntax/test_floor.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
"""
BAR: constant(decimal) = 2.5
FOO: constant(int256) = floor(BAR)
@external
def foo():
a: int256 = FOO
Expand Down
1 change: 1 addition & 0 deletions tests/functional/syntax/test_len.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ def foo(inp: String[10]) -> uint256:
"""
BAR: constant(String[5]) = "vyper"
FOO: constant(uint256) = len(BAR)
@external
def foo() -> uint256:
a: uint256 = FOO
Expand Down
8 changes: 8 additions & 0 deletions tests/functional/syntax/test_minmax.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,11 +41,19 @@ def test_block_fail(assert_compile_failed, get_contract_with_gas_estimation, bad
FOO: constant(uint256) = 123
BAR: constant(uint256) = 456
BAZ: constant(uint256) = min(FOO, BAR)
@external
def foo():
a: uint256 = BAZ
""",
"""
FOO: constant(uint256) = 123
BAR: constant(uint256) = 456
BAZ: constant(uint256) = max(FOO, BAR)
@external
def foo():
a: uint256 = BAZ
""",
]

Expand Down
4 changes: 4 additions & 0 deletions tests/functional/syntax/test_minmax_value.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,10 @@ def foo():
""",
"""
FOO: constant(address) = min_value(address)
@external
def foo():
a: address = FOO
""",
]

Expand Down
4 changes: 4 additions & 0 deletions tests/functional/syntax/test_powmod.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,10 @@ def test_powmod_fail(assert_compile_failed, get_contract_with_gas_estimation, ba
FOO: constant(uint256) = 3
BAR: constant(uint256) = 5
BAZ: constant(uint256) = pow_mod256(FOO, BAR)
@external
def foo():
a: uint256 = BAZ
"""
]

Expand Down
4 changes: 4 additions & 0 deletions tests/functional/syntax/test_uint2str.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,10 @@
"""
FOO: constant(uint256) = 3
BAR: constant(String[78]) = uint2str(FOO)
@external
def foo():
a: String[78] = BAR
"""
]

Expand Down

0 comments on commit 81d1bfb

Please sign in to comment.