From 5bade81ddb7c693ec023624d6e3db4c72c4c5335 Mon Sep 17 00:00:00 2001 From: David Mak Date: Thu, 20 Jun 2024 11:46:34 +0800 Subject: [PATCH] standalone: Add test for multidim array index with one index --- nac3standalone/demo/src/ndarray.py | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/nac3standalone/demo/src/ndarray.py b/nac3standalone/demo/src/ndarray.py index 2b948b17..eb124351 100644 --- a/nac3standalone/demo/src/ndarray.py +++ b/nac3standalone/demo/src/ndarray.py @@ -150,6 +150,15 @@ def test_ndarray_slices(): x2 = x[0::2, 0::2] output_ndarray_float_2(x2) +def test_ndarray_nd_idx(): + x = np_identity(2) + + x0: float = x[0, 0] + output_float64(x0) + output_float64(x[0, 1]) + output_float64(x[1, 0]) + output_float64(x[1, 1]) + def test_ndarray_add(): x = np_identity(2) y = x + np_ones([2, 2]) @@ -1393,6 +1402,7 @@ def run() -> int32: test_ndarray_neg_idx() test_ndarray_slices() + test_ndarray_nd_idx() test_ndarray_add() test_ndarray_add_broadcast()