예제 #1
0
파일: test_core.py 프로젝트: joyrexus/toolz
def test_sliding_window_of_short_iterator():
    assert list(sliding_window(3, [1, 2])) == []
예제 #2
0
파일: test_core.py 프로젝트: joyrexus/toolz
def test_sliding_window():
    assert list(sliding_window(2, [1, 2, 3, 4])) == [(1, 2), (2, 3), (3, 4)]
    assert list(sliding_window(3, [1, 2, 3, 4])) == [(1, 2, 3), (2, 3, 4)]