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

Function test_loop_first_last

tests/test_tools.py:23–29  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

21
22
23def test_loop_first_last():
24 assert list(loop_first_last([])) == []
25 iterable = loop_first_last(["apples", "oranges", "pears", "lemons"])
26 assert next(iterable) == (True, False, "apples")
27 assert next(iterable) == (False, False, "oranges")
28 assert next(iterable) == (False, False, "pears")
29 assert next(iterable) == (False, True, "lemons")
30
31
32def test_ratio_distribute():

Callers

nothing calls this directly

Calls 1

loop_first_lastFunction · 0.90

Tested by

no test coverage detected