2
0
mirror of https://github.com/m-labs/artiq.git synced 2025-01-23 17:08:12 +08:00

test_embedding: add bool list reg test

This commit is contained in:
Simon Renblad 2025-01-20 10:33:42 +08:00 committed by Sébastien Bourdeauducq
parent 0da4dbf2f2
commit 415895413c

View File

@ -599,3 +599,29 @@ class _IntBoundary(EnvExperiment):
class IntBoundaryTest(ExperimentCase): class IntBoundaryTest(ExperimentCase):
def test_int_boundary(self): def test_int_boundary(self):
self.create(_IntBoundary).run() self.create(_IntBoundary).run()
class _BoolListType(EnvExperiment):
def assert_bool(self, obj):
assert isinstance(obj, bool)
def build(self):
self.setattr_device("core")
self.x = [True]
self.y = [numpy.True_]
@kernel
def run_bool(self):
self.assert_bool(self.x[0])
@kernel
def run_numpy_bool(self):
self.assert_bool(self.y[0])
class BoolListTypeTest(ExperimentCase):
def test_bool_list(self):
self.create(_BoolListType).run_bool()
def test_np_bool_list(self):
self.create(_BoolListType).run_numpy_bool()