<commit_before><?php

/**
 * PHP Version 5.3
 *
 * @copyright   (c) 2014-2015 <NAME>
 * @author      <NAME> <<EMAIL>>
 * @license     http://opensource.org/licenses/MIT MIT
 *
 * For the full copyright and license information, please view the LICENSE
 * file that was distributed with this source code.
 */

namespace ptlis\SemanticVersion\Test\Parse;

use ptlis\SemanticVersion\Parse\Token;
use ptlis\SemanticVersion\Parse\VersionParser;
use ptlis\SemanticVersion\Version\Label\LabelBuilder;

class ParseRangeTest extends TestDataProvider
{
    /**
     * @dataProvider tokenProvider
     *
     * @param string $version
     * @param Token[] $tokenList
     * @param array $expectedValueList
     */
    public function testParseRange($version, $tokenList, $expectedValueList, $expectedSerialization)
    {
        $parser = new VersionParser(new LabelBuilder());

        $range = $parser->parseRange($tokenList);

        $this->assertEquals(
            $expectedValueList,
            $range
        );

        $this->assertEquals(
            $expectedSerialization,
            strval($range)
        );
    }
}<commit_msg>Refactor parser tests to split out checks<commit_after><?php

/**
 * PHP Version 5.3
 *
 * @copyright   (c) 2014-2015 <NAME>
 * @author      <NAME> <<EMAIL>>
 * @license     http://opensource.org/licenses/MIT MIT
 *
 * For the full copyright and license information, please view the LICENSE
 * file that was distributed with this source code.
 */

namespace ptlis\SemanticVersion\Test\Parse;

use ptlis\SemanticVersion\Parse\VersionParser;
use ptlis\SemanticVersion\Version\Label\LabelBuilder;

class ParseRangeTest extends TestDataProvider
{
    /**
     * @dataProvider tokenProvider
     */
    public function testParseRange($version, $tokenList, $expectedRange, $expectedSerialization)
    {
        $parser = new VersionParser(new LabelBuilder());

        $range = $parser->parseRange($tokenList);

        $this->assertEquals(
            $expectedRange,
            $range
        );

        $this->assertEquals(
            $expectedSerialization,
            strval($range)
        );
    }

    /**
     * @dataProvider tokenProvider
     */
    public function testSerializeRange($version, $tokenList, $expectedRange, $expectedSerialization)
    {
        $this->assertEquals(
            $expectedSerialization,
            strval($expectedRange)
        );
    }
}
{'fraction_non_alphanumeric': 0.10986733001658375, 'fraction_numerical': 0.008291873963515755, 'mean_word_length': 2.735294117647059, 'pattern_counts': {'":': 0, '<': 13, '<?xml version=': 0, '>': 18, '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': '3285972', 'n_tokens_mistral': 676, 'n_tokens_neox': 660, 'n_words': 154}