From 6fa2bb161e331c85ba4c6f79e73642e68dd7a008 Mon Sep 17 00:00:00 2001 From: Taiju Yamada Date: Wed, 15 Jun 2022 13:17:11 +0900 Subject: [PATCH] actually need both tests --- tests/test_pytypes.cpp | 8 ++++++-- tests/test_pytypes.py | 3 ++- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/tests/test_pytypes.cpp b/tests/test_pytypes.cpp index e9e14ce34..196114745 100644 --- a/tests/test_pytypes.cpp +++ b/tests/test_pytypes.cpp @@ -127,8 +127,12 @@ TEST_SUBMODULE(pytypes, m) { m.def("tuple_size_t", []() { return py::tuple{(py::size_t) 0}; }); m.def("get_tuple", []() { return py::make_tuple(42, py::none(), "spam"); }); m.def("access_tuple_with_int_index", []() { - py::object tpl = py::make_tuple(py::make_tuple(1, 2), py::make_tuple(3, 4)); - return tpl[0][1]; + py::object tpl = py::make_tuple(1, 2); + return tpl[1]; + }); + m.def("access_tuple_with_int_index_multidimension", []() { + py::object tpl = py::make_tuple(py::make_tuple(1, 2, 3), py::make_tuple(3, 4, 5)); + return tpl[1][2]; }); // test_simple_namespace diff --git a/tests/test_pytypes.py b/tests/test_pytypes.py index 23fb582d3..760f6236d 100644 --- a/tests/test_pytypes.py +++ b/tests/test_pytypes.py @@ -152,7 +152,8 @@ def test_tuple(): assert m.tuple_ssize_t() == () assert m.tuple_size_t() == () assert m.get_tuple() == (42, None, "spam") - # assert m.access_tuple_with_int_index() == (2) + assert m.access_tuple_with_int_index() == 2 + assert m.access_tuple_with_int_index_multidimension() == 5 def test_simple_namespace():