Added support for list insertion. (#1888)

This commit is contained in:
kingofpayne
2019-08-19 23:00:36 +02:00
committed by Wenzel Jakob
parent 19189b4c2c
commit 12e8774bc9
3 changed files with 11 additions and 3 deletions

View File

@@ -9,14 +9,16 @@ from pybind11_tests import debug_enabled
def test_list(capture, doc):
with capture:
lst = m.get_list()
assert lst == ["overwritten"]
assert lst == ["inserted-0", "overwritten", "inserted-2"]
lst.append("value2")
m.print_list(lst)
assert capture.unordered == """
Entry at position 0: value
list item 0: overwritten
list item 1: value2
list item 0: inserted-0
list item 1: overwritten
list item 2: inserted-2
list item 3: value2
"""
assert doc(m.get_list) == "get_list() -> list"