From 9bc270443068c90298c0220cd866fbf9ea1bb589 Mon Sep 17 00:00:00 2001 From: Ed Catmur Date: Sun, 24 Apr 2022 22:39:47 +0100 Subject: [PATCH] Add tests for cast from tuple to sequence containers (#3900) We already test that tuple can cast to std::vector and std::deque; add tests for std::vector, std::list and std::valarray. Extracted from #3886. --- tests/test_stl.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/tests/test_stl.py b/tests/test_stl.py index 3dc55230a..975860b85 100644 --- a/tests/test_stl.py +++ b/tests/test_stl.py @@ -14,6 +14,7 @@ def test_vector(doc): assert m.cast_bool_vector() == [True, False] assert m.load_bool_vector([True, False]) + assert m.load_bool_vector(tuple([True, False])) assert doc(m.cast_vector) == "cast_vector() -> List[int]" assert doc(m.load_vector) == "load_vector(arg0: List[int]) -> bool" @@ -36,6 +37,7 @@ def test_array(doc): lst = m.cast_array() assert lst == [1, 2] assert m.load_array(lst) + assert m.load_array(tuple(lst)) assert doc(m.cast_array) == "cast_array() -> List[int[2]]" assert doc(m.load_array) == "load_array(arg0: List[int[2]]) -> bool" @@ -46,6 +48,7 @@ def test_valarray(doc): lst = m.cast_valarray() assert lst == [1, 4, 9] assert m.load_valarray(lst) + assert m.load_valarray(tuple(lst)) assert doc(m.cast_valarray) == "cast_valarray() -> List[int]" assert doc(m.load_valarray) == "load_valarray(arg0: List[int]) -> bool"