mirror of
https://github.com/pybind/pybind11.git
synced 2026-03-14 20:27:47 +00:00
Added support for list insertion. (#1888)
This commit is contained in:
committed by
Wenzel Jakob
parent
19189b4c2c
commit
12e8774bc9
@@ -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"
|
||||
|
||||
Reference in New Issue
Block a user