MCPcopy Create free account
hub / github.com/davisking/dlib / test_range

Function test_range

tools/python/test/test_range.py:9–21  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

7
8
9def test_range():
10 r = range(0, 10)
11 assert r.begin == 0
12 assert r.end == 10
13 assert str(r) == "0, 10"
14 assert repr(r) == "dlib.range(0, 10)"
15 assert len(r) == 10
16
17 ser = pickle.dumps(r, 2)
18 deser = pickle.loads(ser)
19
20 for a, b in zip(r, deser):
21 assert a == b
22
23
24# TODO: make this init parameterization an exception?

Callers

nothing calls this directly

Calls 4

rangeFunction · 0.90
strClass · 0.85
reprFunction · 0.85
lenFunction · 0.85

Tested by

no test coverage detected