Skip to content

Commit

Permalink
test/test_size: fix slice comparison
Browse files Browse the repository at this point in the history
sbourdeauducq committed Nov 3, 2014
1 parent dcedc4e commit ccc9a0d
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion migen/test/test_size.py
Original file line number Diff line number Diff line change
@@ -2,6 +2,9 @@

from migen.fhdl.std import *

def _same_slices(a, b):
return a.value is b.value and a.start == b.start and a.stop == b.stop

class SignalSizeCase(unittest.TestCase):
def setUp(self):
self.i = 0xaa
@@ -18,7 +21,7 @@ def test_flen_type(self):

def test_fiter(self):
for i, si in enumerate(fiter(self.s)):
self.assertEqual(si, self.s[i])
self.assertTrue(_same_slices(si, self.s[i]))
self.assertEqual(list(fiter(self.i)),
[(self.i >> i) & 1 for i in range(8)])
self.assertEqual(list(fiter(self.j)),

0 comments on commit ccc9a0d

Please sign in to comment.