fn bounded_iterator_boundary_start() {
        let list = StableList::new();
        for i in 0..(CHUNK_SIZE * 2) {
            list.push(i * 2);
        }
        let expected = ((CHUNK_SIZE - 1)..=(CHUNK_SIZE + 1))
            .map(|v| v * 2)
            .collect::<Vec<usize>>();
        let mut lower_iter = list.bounded_iter(CHUNK_SIZE - 1, None);
        let mut middle_iter = list.bounded_iter(CHUNK_SIZE, None);
        let mut upper_iter = list.bounded_iter(CHUNK_SIZE + 1, None);
        assert_eq!(
            expected,
            lower_iter.take(3).copied().collect::<Vec<usize>>()
        );
        assert_eq!(
            expected[1..],
            middle_iter.take(2).copied().collect::<Vec<usize>>()
        );
        assert_eq!(expected.get(2), upper_iter.next());
    }
/// Test that iterators started around BLOCK_SIZE doesn't encounter edge cases
Test that iterators started around BLOCK_SIZE doesn't encounter edge cases
Test that iterators started around BLOCK_SIZE doesn ' t encounter edge cases
fn bounded_iterator_boundary_start() {
        let list = StableList::new();
        for i in 0..(CHUNK_SIZE * 2) {
            list.push(i * 2);
        }
        let expected = ((CHUNK_SIZE - 1)..=(CHUNK_SIZE + 1))
            .map(|v| v * 2)
            .collect::<Vec<usize>>();
        let mut lower_iter = list.bounded_iter(CHUNK_SIZE - 1, None);
        let mut middle_iter = list.bounded_iter(CHUNK_SIZE, None);
        let mut upper_iter = list.bounded_iter(CHUNK_SIZE + 1, None);
        assert_eq!(
            expected,
            lower_iter.take(3).copied().collect::<Vec<usize>>()
        );
        assert_eq!(
            expected[1..],
            middle_iter.take(2).copied().collect::<Vec<usize>>()
        );
        assert_eq!(expected.get(2), upper_iter.next());
    }
fn bounded_iterator_boundary_start ( ) { let list = StableList :: new ( ) ; for i in 0 .. ( CHUNK_SIZE * 2 ) { list . push ( i * 2 ) ; } let expected = ( ( CHUNK_SIZE - 1 ) ..= ( CHUNK_SIZE + 1 ) ) . map ( | v | v * 2 ) . collect :: < Vec < usize > > ( ) ; let mut lower_iter = list . bounded_iter ( CHUNK_SIZE - 1 , None ) ; let mut middle_iter = list . bounded_iter ( CHUNK_SIZE , None ) ; let mut upper_iter = list . bounded_iter ( CHUNK_SIZE + 1 , None ) ; assert_eq ! ( expected lower_iter take ( 3 ) copied ( ) collect Vec usize ( ) ) ; assert_eq ! ( expected [ 1 ] middle_iter take ( 2 ) copied ( ) collect Vec usize ( ) ) ; assert_eq ! ( expected get ( 2 ) upper_iter next ( ) ) ; }
Test that iterators started around BLOCK_SIZE doesn't encounter edge cases
Test that iterators started around BLOCK_SIZE doesn ' t encounter edge cases