hdl.ir: type check ports.

Fixes #290.
This commit is contained in:
whitequark 2020-02-06 17:33:41 +00:00
parent 882fddfa96
commit 97cc78a3db
2 changed files with 19 additions and 5 deletions

View file

@ -298,6 +298,11 @@ class FragmentPortsTestCase(FHDLTestCase):
(sync.rst, "i"),
]))
def test_port_wrong(self):
f = Fragment()
with self.assertRaises(TypeError,
msg="Only signals may be added as ports, not (const 1'd1)"):
f.prepare(ports=(Const(1),))
class FragmentDomainsTestCase(FHDLTestCase):
def test_iter_signals(self):