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

Function test_ranges

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

Source from the content-addressed store, hash-verified

39
40
41def test_ranges():
42 rs = ranges()
43 assert len(rs) == 0
44
45 rs.resize(5)
46 assert len(rs) == 5
47 for r in rs:
48 assert r.begin == 0
49 assert r.end == 0
50
51 rs.clear()
52 assert len(rs) == 0
53
54 rs.extend([range(1, 2), range(3, 4)])
55 assert rs[0].begin == 1
56 assert rs[0].end == 2
57 assert rs[1].begin == 3
58 assert rs[1].end == 4
59
60 ser = pickle.dumps(rs, 2)
61 deser = pickle.loads(ser)
62 assert rs == deser
63
64
65def test_rangess():

Callers

nothing calls this directly

Calls 4

rangeFunction · 0.90
lenFunction · 0.85
resizeMethod · 0.45
clearMethod · 0.45

Tested by

no test coverage detected