hdl.dsl: allow adding submodules with computed name, like with domains.
This commit is contained in:
parent
b64a31255c
commit
b8a61edc2f
2 changed files with 9 additions and 0 deletions
|
|
@ -505,6 +505,12 @@ class DSLTestCase(FHDLTestCase):
|
|||
m1.submodules.foo = m2
|
||||
self.assertEqual(m1._submodules, [(m2, "foo")])
|
||||
|
||||
def test_submodule_named_index(self):
|
||||
m1 = Module()
|
||||
m2 = Module()
|
||||
m1.submodules["foo"] = m2
|
||||
self.assertEqual(m1._submodules, [(m2, "foo")])
|
||||
|
||||
def test_submodule_wrong(self):
|
||||
m = Module()
|
||||
with self.assertRaises(TypeError,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue