Skip to content

Commit

Permalink
Add test for issue #74
Browse files Browse the repository at this point in the history
  • Loading branch information
cdonovick committed Jul 25, 2019
1 parent 3752bc4 commit ca9239b
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion tests/test_rebind.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@

from hwtypes.adt import Product, Sum, Enum, Tuple
from hwtypes.adt_util import rebind_bitvector
from hwtypes.bit_vector import AbstractBitVector, BitVector
from hwtypes.bit_vector import AbstractBitVector, BitVector, AbstractBit, Bit
from hwtypes.smt_bit_vector import SMTBit
from hwtypes.util import _issubclass

class A: pass
Expand Down Expand Up @@ -139,3 +140,10 @@ def test_rebind_bv():
assert P_unbound.X == AbstractBitVector[16]
assert P_unbound.S == Sum[AbstractBitVector[4], AbstractBitVector[8]]
assert P_unbound.T[0] == AbstractBitVector[32]

def test_issue_74():
class A(Product):
a = Bit

A_smt = A.rebind(AbstractBit, SMTBit, True)
assert A_smt.a is SMTBit

0 comments on commit ca9239b

Please sign in to comment.