hdl.ast: improve repr() for Shape.
The default __repr__() from typing.NamedTuple does not include the module name, so the replacement (which uses the preferred syntax for specifying these shapes) doesn't either.
This commit is contained in:
parent
9055090f65
commit
e9c75f7ca1
2 changed files with 10 additions and 0 deletions
|
|
@ -39,6 +39,10 @@ class ShapeTestCase(FHDLTestCase):
|
|||
msg="Width must be a non-negative integer, not -1"):
|
||||
Shape(-1)
|
||||
|
||||
def test_repr(self):
|
||||
self.assertEqual(repr(Shape()), "unsigned(1)")
|
||||
self.assertEqual(repr(Shape(2, True)), "signed(2)")
|
||||
|
||||
def test_tuple(self):
|
||||
width, signed = Shape()
|
||||
self.assertEqual(width, 1)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue