<commit_before><?php

namespace Salavert\Tests;

use Salavert\OpenLocationCode;

class OpenLocationCodeTest extends \PHPUnit_Framework_TestCase {

    /**
     * @var OpenLocationCode $olc
     */
    private $olc;

    public function setUp() {
        $this->olc = new OpenLocationCode();
    }

    /**
     * @dataProvider validShortCodes
     */
    public function testIsValidMethodWithValidShortCodes($code)
    {
        $this->assertTrue($this->olc->isValid($code));
    }

    /**
     * @dataProvider validFullCodes
     */
    public function testIsValidMethodWithValidFullCodes($code)
    {
        $this->assertTrue($this->olc->isValid($code));
    }

    /**
     * @dataProvider invalidCodes
     */
    public function testIsValidMethodWithInvalidCodes($code)
    {
        $this->assertFalse($this->olc->isValid($code));
    }

    /**
     * @dataProvider validShortCodes
     */
    public function testIsShortMethodWithValidShortCodes($code)
    {
        $this->assertTrue($this->olc->isShort($code));
    }

    /**
     * @dataProvider validFullCodes
     */
    public function testIsShortMethodWithValidFullCodes($code)
    {
        $this->assertFalse($this->olc->isShort($code));
    }

    /**
     * @dataProvider invalidCodes
     */
    public function testIsShortMethodWithInvalidCodes($code)
    {
        $this->assertFalse($this->olc->isShort($code));
    }

    /**
     * @dataProvider validShortCodes
     */
    public function testIsFullMethodWithValidShortCodes($code)
    {
        $this->assertFalse($this->olc->isFull($code));
    }

    /**
     * @dataProvider validFullCodes
     */
    public function testIsFullMethodWithValidFullCodes($code)
    {
        $this->assertTrue($this->olc->isFull($code));
    }

    /**
     * @dataProvider invalidCodes
     */
    public function testIsFullMethodWithInvalidCodes($code)
    {
        $this->assertFalse($this->olc->isFull($code));
    }

    public function validShortCodes()
    {
        return array(
            array('WC2345+G6g'),
            array('2345+G6'),
            array('45+G6'),
            array('+G6'),
        );
    }

    public function validFullCodes()
    {
        return array(
            array('8FWC2345+G6'),
            array('8FWC2345+G6G'),
            array('8fwc2345+'),
            array('8FWCX400+'),
        );
    }

    public function invalidCodes()
    {
        return array(
            array('8FWC2345+G'),
            array('8FWC2_45+G6'),
            array('8FWC2η45+G6'),
            array('8FWC2345+G6+'),
            array('8FWC2300+G6'),
            array('WC2300+G6g'),
            array('WC2345+G'),
        );
    }

}
<commit_msg>Reducing amount of tests by grouping them<commit_after><?php

namespace Salavert\Tests;

use Salavert\OpenLocationCode;

class OpenLocationCodeTest extends \PHPUnit_Framework_TestCase {

    /**
     * @var OpenLocationCode $olc
     */
    private $olc;

    public function setUp() {
        $this->olc = new OpenLocationCode();
    }

    /**
     * @dataProvider validFullCodes
     */
    public function testValidFullCodes($code)
    {
        $this->assertTrue($this->olc->isValid($code));
        $this->assertFalse($this->olc->isShort($code));
        $this->assertTrue($this->olc->isFull($code));
    }

    /**
     * @dataProvider validShortCodes
     */
    public function testValidShortCodes($code)
    {
        $this->assertTrue($this->olc->isValid($code));
        $this->assertTrue($this->olc->isShort($code));
        $this->assertFalse($this->olc->isFull($code));
    }

    /**
     * @dataProvider invalidCodes
     */
    public function testInvalidCodes($code)
    {
        $this->assertFalse($this->olc->isValid($code));
        $this->assertFalse($this->olc->isShort($code));
        $this->assertFalse($this->olc->isFull($code));
    }

    public function validShortCodes()
    {
        return array(
            array('WC2345+G6g'),
            array('2345+G6'),
            array('45+G6'),
            array('+G6'),
        );
    }

    public function validFullCodes()
    {
        return array(
            array('8FWC2345+G6'),
            array('8FWC2345+G6G'),
            array('8fwc2345+'),
            array('8FWCX400+'),
        );
    }

    public function invalidCodes()
    {
        return array(
            array('8FWC2345+G'),
            array('8FWC2_45+G6'),
            array('8FWC2η45+G6'),
            array('8FWC2345+G6+'),
            array('8FWC2300+G6'),
            array('WC2300+G6g'),
            array('WC2345+G'),
        );
    }

}

{'fraction_non_alphanumeric': 0.14965095986038393, 'fraction_numerical': 0.030977312390924956, 'mean_word_length': 2.1598897312198484, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 59, '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': '5371697', 'n_tokens_mistral': 1482, 'n_tokens_neox': 1451, 'n_words': 184}