From c458d1e7d55868334305a57dbd44bd0382de63f2 Mon Sep 17 00:00:00 2001 From: Luke Kenneth Casson Leighton Date: Sun, 5 Apr 2020 12:46:24 +0100 Subject: [PATCH] add selectconcat test --- src/soc/decoder/selectable_int.py | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/src/soc/decoder/selectable_int.py b/src/soc/decoder/selectable_int.py index 130b2978..fb064fcb 100644 --- a/src/soc/decoder/selectable_int.py +++ b/src/soc/decoder/selectable_int.py @@ -264,5 +264,16 @@ class SelectableIntTestCase(unittest.TestCase): a[0:4] = a[4:8] self.assertEqual(a, 0x199) + def test_concat(self): + a = SelectableInt(0x1, 1) + c = selectconcat(a, repeat=8) + self.assertEqual(c, 0xff) + self.assertEqual(c.bits, 8) + a = SelectableInt(0x0, 1) + c = selectconcat(a, repeat=8) + self.assertEqual(c, 0x00) + self.assertEqual(c.bits, 8) + + if __name__ == "__main__": unittest.main() -- 2.30.2