hdl.ast: handle int subclasses as slice start/stop values.
[nmigen.git] / tests / test_hdl_ast.py
index af073a984fdc97fd55b88ccb7adac9226fde113e..78c956d650dfec2222d84abbadae4a4d2161419d 100644 (file)
@@ -630,6 +630,12 @@ class SliceTestCase(FHDLTestCase):
         s1 = Slice(c, -4, -1)
         self.assertEqual((s1.start, s1.stop), (4, 7))
 
+    def test_start_end_bool(self):
+        c  = Const(0, 8)
+        s  = Slice(c, False, True)
+        self.assertIs(type(s.start), int)
+        self.assertIs(type(s.stop),  int)
+
     def test_start_end_wrong(self):
         with self.assertRaisesRegex(TypeError,
                 r"^Slice start must be an integer, not 'x'$"):