From 415895413c98c44ef26c1525d2b53a729f964f81 Mon Sep 17 00:00:00 2001 From: Simon Renblad Date: Mon, 20 Jan 2025 10:33:42 +0800 Subject: [PATCH] test_embedding: add bool list reg test --- artiq/test/coredevice/test_embedding.py | 26 +++++++++++++++++++++++++ 1 file changed, 26 insertions(+) diff --git a/artiq/test/coredevice/test_embedding.py b/artiq/test/coredevice/test_embedding.py index 46cb8b296..149f3caef 100644 --- a/artiq/test/coredevice/test_embedding.py +++ b/artiq/test/coredevice/test_embedding.py @@ -599,3 +599,29 @@ class _IntBoundary(EnvExperiment): class IntBoundaryTest(ExperimentCase): def test_int_boundary(self): 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()