Skip to content

Commit

Permalink
add (failing) test for issue #194 - boolean conversions of UInt64 don…
Browse files Browse the repository at this point in the history
…'t compare equal
  • Loading branch information
achidlow committed Aug 8, 2024
1 parent 63b14b9 commit 61ee0c1
Show file tree
Hide file tree
Showing 43 changed files with 650 additions and 310 deletions.
3 changes: 2 additions & 1 deletion examples/sizes.txt
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,8 @@
merkle/MerkleTree 206 197 9 197 0
module_consts 52 50 2 50 0
nested_loops/Nested 217 200 17 200 0
regression_118 148 100 48 100 0
regression_tests/Issue118 148 100 48 100 0
regression_tests/Issue194 27 12 15 12 0
reinterpret_cast 127 109 18 109 0
scratch_slots 105 94 11 94 0
scratch_slots/2 105 94 11 94 0
Expand Down
55 changes: 0 additions & 55 deletions test_cases/regression_118/out/Contract.arc32.json

This file was deleted.

9 changes: 0 additions & 9 deletions test_cases/regression_118/out/Contract.clear.mir

This file was deleted.

7 changes: 0 additions & 7 deletions test_cases/regression_118/out/Contract.clear.teal

This file was deleted.

5 changes: 0 additions & 5 deletions test_cases/regression_118/out_O2/Contract.clear.teal

This file was deleted.

7 changes: 0 additions & 7 deletions test_cases/regression_118/out_unoptimized/Contract.clear.teal

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@
from algopy.arc4 import Bool, DynamicArray, String, Tuple, UInt256, abimethod


class Contract(ARC4Contract):
class Issue118(ARC4Contract):
# ref: https://github.com/algorandfoundation/puya/issues/118
@abimethod
def verify(self, values: DynamicArray[UInt256]) -> Tuple[Bool, String]:
val1 = Bool(
Expand Down
16 changes: 16 additions & 0 deletions test_cases/regression_tests/issue_194.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
from algopy import Contract, UInt64


class Issue194(Contract):
# ref: https://github.com/algorandfoundation/puya/issues/194
def approval_program(self) -> bool:
assert bool(UInt64(1)) == bool(UInt64(2))
two = UInt64(2)
match bool(two):
case True:
return True
case _:
return False

def clear_state_program(self) -> bool:
return True
Loading

0 comments on commit 61ee0c1

Please sign in to comment.