<commit_before><?php

namespace Ardent;

use Ardent\Iterator\ArrayIterator;

class SkippingIteratorTest extends \PHPUnit_Framework_TestCase {

    function provideCases() {
        $insert = [1,2,3,4,5];
        return [
            'empty' => [
                'insert' => [],
                'skip'   => 2,
                'expect' => [],
                'expectPreserveKeys' => [],
            ],
            '2' => [
                'insert' => $insert,
                'skip'   => 2,
                'expect' => [3,4,5],
                'expectPreserveKeys' => [
                    2 => 3,
                    3 => 4,
                    4 => 5
                ],
            ],
            '-2' => [
                'insert' => $insert,
                'skip'   => -2,
                'expect' => $insert,
                'expectPreserveKeys' => $insert,
            ],
        ];
    }

    /**
     * @dataProvider provideCases
     */
    function testCases(array $insert, $skip, array $expect, array $expectPreserveKeys) {
        $iterator = new ArrayIterator($insert);
        $skipped = $iterator->skip($skip);

        $this->assertCount(count($expect), $skipped);
        $this->assertEquals($expect, $skipped->toArray(FALSE));
        $this->assertEquals($expectPreserveKeys, $skipped->toArray(TRUE));

    }

}
<commit_msg>Added a skip all test.<commit_after><?php

namespace Ardent;

use Ardent\Iterator\ArrayIterator;

class SkippingIteratorTest extends \PHPUnit_Framework_TestCase {

    function provideCases() {
        $insert = [1,2,3,4,5];
        return [
            'empty' => [
                'insert' => [],
                'skip'   => 2,
                'expect' => [],
                'expectPreserveKeys' => [],
            ],
            'all' => [
                'insert' => $insert,
                'skip'   => count($insert),
                'expect' => [],
                'expectPreserveKeys' => [],
            ],
            '2' => [
                'insert' => $insert,
                'skip'   => 2,
                'expect' => [3,4,5],
                'expectPreserveKeys' => [
                    2 => 3,
                    3 => 4,
                    4 => 5
                ],
            ],
            '-2' => [
                'insert' => $insert,
                'skip'   => -2,
                'expect' => $insert,
                'expectPreserveKeys' => $insert,
            ],
        ];
    }

    /**
     * @dataProvider provideCases
     */
    function testCases(array $insert, $skip, array $expect, array $expectPreserveKeys) {
        $iterator = new ArrayIterator($insert);
        $skipped = $iterator->skip($skip);

        $this->assertCount(count($expect), $skipped);
        $this->assertEquals($expect, $skipped->toArray(FALSE));
        $this->assertEquals($expectPreserveKeys, $skipped->toArray(TRUE));

    }

}

{'fraction_non_alphanumeric': 0.15453915453915454, 'fraction_numerical': 0.013167013167013167, 'mean_word_length': 1.3133012820512822, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 56, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '7042114', 'n_tokens_mistral': 844, 'n_tokens_neox': 787, 'n_words': 139}