Tests that stl casters preserve lvalue/rvalue context for container values
()
| 104 | |
| 105 | |
| 106 | def test_recursive_casting(): |
| 107 | """Tests that stl casters preserve lvalue/rvalue context for container values""" |
| 108 | assert m.cast_rv_vector() == ["rvalue", "rvalue"] |
| 109 | assert m.cast_lv_vector() == ["lvalue", "lvalue"] |
| 110 | assert m.cast_rv_array() == ["rvalue", "rvalue", "rvalue"] |
| 111 | assert m.cast_lv_array() == ["lvalue", "lvalue"] |
| 112 | assert m.cast_rv_map() == {"a": "rvalue"} |
| 113 | assert m.cast_lv_map() == {"a": "lvalue", "b": "lvalue"} |
| 114 | assert m.cast_rv_nested() == [[[{"b": "rvalue", "c": "rvalue"}], [{"a": "rvalue"}]]] |
| 115 | assert m.cast_lv_nested() == { |
| 116 | "a": [[["lvalue", "lvalue"]], [["lvalue", "lvalue"]]], |
| 117 | "b": [[["lvalue", "lvalue"], ["lvalue", "lvalue"]]], |
| 118 | } |
| 119 | |
| 120 | # Issue #853 test case: |
| 121 | z = m.cast_unique_ptr_vector() |
| 122 | assert z[0].value == 7 |
| 123 | assert z[1].value == 42 |
| 124 | |
| 125 | |
| 126 | def test_move_out_container(): |
nothing calls this directly
no outgoing calls
no test coverage detected