Exemple #1
0
def test_sliding_window_of_short_iterator():
    assert list(sliding_window(3, [1, 2])) == []
Exemple #2
0
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)]