hdl.ast: fix range handling in Shape.cast.

Fixes #803.
This commit is contained in:
Marcelina Kościelnicka 2023-06-07 11:45:56 +02:00 committed by Catherine
parent fcbc8bd46f
commit c7984463c7
2 changed files with 6 additions and 3 deletions

View file

@ -117,6 +117,9 @@ class ShapeTestCase(FHDLTestCase):
s7 = Shape.cast(range(-1, -1))
self.assertEqual(s7.width, 0)
self.assertEqual(s7.signed, True)
s8 = Shape.cast(range(0, 10, 3))
self.assertEqual(s8.width, 4)
self.assertEqual(s8.signed, False)
def test_cast_enum(self):
s1 = Shape.cast(UnsignedEnum)