MCPcopy
hub / github.com/Textualize/rich / test_loop_last

Function test_loop_last

tests/test_tools.py:14–20  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

12
13
14def test_loop_last():
15 assert list(loop_last([])) == []
16 iterable = loop_last(["apples", "oranges", "pears", "lemons"])
17 assert next(iterable) == (False, "apples")
18 assert next(iterable) == (False, "oranges")
19 assert next(iterable) == (False, "pears")
20 assert next(iterable) == (True, "lemons")
21
22
23def test_loop_first_last():

Callers

nothing calls this directly

Calls 1

loop_lastFunction · 0.90

Tested by

no test coverage detected