mirror of
https://github.com/m-labs/artiq.git
synced 2025-01-23 09:06:42 +08:00
test_embedding: add bool list reg test
This commit is contained in:
parent
0da4dbf2f2
commit
415895413c
@ -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()
|
||||||
|
Loading…
Reference in New Issue
Block a user