actually need both tests

This commit is contained in:
Taiju Yamada 2022-06-15 13:17:11 +09:00
parent 4b3f145b94
commit 6fa2bb161e
2 changed files with 8 additions and 3 deletions

View File

@ -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

View File

@ -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():