Esempio n. 1
0
def test_intersperse_lengthhint1():
    it = intersperse([1, 2, 3], 2)
    _hf.check_lengthhint_iteration(it, 5)
Esempio n. 2
0
def test_merge_lengthhint1():
    it = merge([0], [1, 2, 3], [1])
    _hf.check_lengthhint_iteration(it, 5)
def test_roundrobin_lengthhint1():
    it = roundrobin([0], [1, 2, 3], [1])
    _hf.check_lengthhint_iteration(it, 5)
def test_successive_lengthhint1():
    it = successive([0] * 6, 4)
    _hf.check_lengthhint_iteration(it, 3)
Esempio n. 5
0
def test_replicate_lengthhint1():
    it = replicate([T(1), T(2)], 3)
    _hf.check_lengthhint_iteration(it, 6)
def test_grouper_lengthhint1(length, it):
    _hf.check_lengthhint_iteration(it, length)
Esempio n. 7
0
def test_sideeffects_lengthhint1():
    it = sideeffects([1, 2, 3, 4, 5, 6], return_None)
    _hf.check_lengthhint_iteration(it, 6)
Esempio n. 8
0
def test_clamp_lengthhint2():
    # When low and high are not given we can determine the length-hint
    it = clamp(toT(range(5)))
    _hf.check_lengthhint_iteration(it, 5)
Esempio n. 9
0
def test_clamp_lengthhint1():
    # When remove=False we can determine the length-hint.
    it = clamp(toT(range(5)), low=T(2), high=T(5), remove=False)
    _hf.check_lengthhint_iteration(it, 5)
def test_accumulate_lengthhint1():
    it = accumulate([1, 2, 3, 4])
    _hf.check_lengthhint_iteration(it, 4)