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

Function test_loop_first

tests/test_tools.py:5–11  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

3
4
5def test_loop_first():
6 assert list(loop_first([])) == []
7 iterable = loop_first(["apples", "oranges", "pears", "lemons"])
8 assert next(iterable) == (True, "apples")
9 assert next(iterable) == (False, "oranges")
10 assert next(iterable) == (False, "pears")
11 assert next(iterable) == (False, "lemons")
12
13
14def test_loop_last():

Callers

nothing calls this directly

Calls 1

loop_firstFunction · 0.90

Tested by

no test coverage detected