Skip to content

Commit

Permalink
fixup tests
Browse files Browse the repository at this point in the history
  • Loading branch information
charles-cooper committed Feb 22, 2024
1 parent a60ab67 commit d178111
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 21 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -713,7 +713,7 @@ def foo():
for i: uint256 in range(a):
pass
""",
TypeMismatch,
StructureException,
),
(
"""
Expand All @@ -723,7 +723,7 @@ def foo():
for i: int128 in range(a,a-3):
pass
""",
TypeMismatch,
StructureException,
),
# invalid argument length
(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ def foo() -> int128:
return 5
@external
def bar():
for i: int128 in range(self.foo(), self.foo() + 1):
for i: int128 in range(self.foo(), bound=100):
pass""",
"""
glob: int128
Expand All @@ -70,12 +70,6 @@ def bar():
for i: int128 in [1,2,3,4,self.foo()]:
pass""",
"""
@external
def foo():
x: int128 = 5
for i: int128 in range(x):
pass""",
"""
f:int128
@internal
Expand Down
24 changes: 12 additions & 12 deletions tests/functional/syntax/test_for_range.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ def foo():
for _: uint256 in range(10, bound=x):
pass
""",
TypeMismatch,
StructureException,
"Bound must be a literal integer",
None,
"x",
Expand Down Expand Up @@ -100,7 +100,7 @@ def bar():
for i: uint256 in range(x):
pass
""",
TypeMismatch,
StructureException,
"Value must be a literal integer, unless a bound is specified",
None,
"x",
Expand All @@ -113,7 +113,7 @@ def bar():
for i: uint256 in range(0, x):
pass
""",
TypeMismatch,
StructureException,
"Value must be a literal integer, unless a bound is specified",
None,
"x",
Expand All @@ -126,7 +126,7 @@ def repeat(n: uint256) -> uint256:
pass
return n
""",
TypeMismatch,
StructureException,
"Value must be a literal integer, unless a bound is specified",
None,
"n * 10",
Expand All @@ -139,7 +139,7 @@ def bar():
for i: uint256 in range(0, x + 1):
pass
""",
TypeMismatch,
StructureException,
"Value must be a literal integer, unless a bound is specified",
None,
"x + 1",
Expand All @@ -164,7 +164,7 @@ def bar():
for i: uint256 in range(x, x):
pass
""",
TypeMismatch,
StructureException,
"Value must be a literal integer, unless a bound is specified",
None,
"x",
Expand All @@ -177,7 +177,7 @@ def foo():
for i: int128 in range(x, x + 10):
pass
""",
TypeMismatch,
StructureException,
"Value must be a literal integer, unless a bound is specified",
None,
"x",
Expand All @@ -190,7 +190,7 @@ def repeat(n: uint256) -> uint256:
pass
return x
""",
TypeMismatch,
StructureException,
"Value must be a literal integer, unless a bound is specified",
None,
"n",
Expand All @@ -203,7 +203,7 @@ def foo(x: int128):
for i: int128 in range(x, x + y):
pass
""",
TypeMismatch,
StructureException,
"Value must be a literal integer, unless a bound is specified",
None,
"x",
Expand All @@ -215,7 +215,7 @@ def bar(x: uint256):
for i: uint256 in range(3, x):
pass
""",
TypeMismatch,
StructureException,
"Value must be a literal integer, unless a bound is specified",
None,
"x",
Expand Down Expand Up @@ -304,7 +304,7 @@ def foo():
for i:decimal in range(1.1, 2.2):
pass
""",
TypeMismatch,
StructureException,
"Value must be a literal integer, unless a bound is specified",
None,
"1.1",
Expand All @@ -317,7 +317,7 @@ def foo():
for i:decimal in range(x, x + 2.0, bound=10.1):
pass
""",
TypeMismatch,
StructureException,
"Bound must be a literal integer",
None,
"10.1",
Expand Down

0 comments on commit d178111

Please sign in to comment.