Skip to content

Commit

Permalink
Added test for Tuple[T, ...]
Browse files Browse the repository at this point in the history
  • Loading branch information
timohl committed Nov 24, 2024
1 parent c7bcb57 commit 251aeb7
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions tests/test_stl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -489,6 +489,14 @@ TEST_SUBMODULE(stl, m) {
paths[1].cast<std::filesystem::path>().parent_path());
return result;
});
m.def("parent_paths_tuple_ellipsis",
[](const py::typing::Tuple<std::filesystem::path, py::ellipsis> &paths) {
py::typing::Tuple<std::filesystem::path, py::ellipsis> result(paths.size());
for (size_t i = 0; i < paths.size(); ++i) {
result[i] = paths[i].cast<std::filesystem::path>().parent_path();
}
return result;
});
m.def("parent_paths_dict",
[](const py::typing::Dict<std::string, std::filesystem::path> &paths) {
py::typing::Dict<std::string, std::filesystem::path> result;
Expand Down

0 comments on commit 251aeb7

Please sign in to comment.