<commit_before><?php

namespace Gherkins\RegExpBuilderPHP\Test;


class RegExpBuilderTest extends \PHPUnit_Framework_TestCase
{

    /**
     * @var \Gherkins\RegExpBuilderPHP\RegExpBuilder
     */
    public $r;

    public function setUp()
    {
        $this->r = new \Gherkins\RegExpBuilderPHP\RegExpBuilder();
    }

    public function testRegExp()
    {
        $regEx = $this->r
            ->startOfLine()
            ->exactly(1)
            ->of("p")
            ->getRegExp();


        $this->assertTrue(is_string($regEx->getFlags()));
        $this->assertTrue($regEx->getFlags() === "m");

        $this->assertTrue(is_string($regEx->__toString()));
        $this->assertTrue(is_string($regEx->getExpression()));

    }

    public function testLettersDigits()
    {
        $regEx = $this->r
            ->startOfLine()
            ->min(3)
            ->letters()
            ->append($this->r->getNew()->min(2)->digits())
            ->getRegExp();

        $this->assertTrue($regEx->test("asf24"));

        $this->assertFalse($regEx->test("af24"));
        $this->assertFalse($regEx->test("afs4"));
        $this->assertFalse($regEx->test("234asas"));

    }

    public function testNotLetter()
    {
        $regEx = $this->r
            ->startOfLine()
            ->notLetter()
            ->getRegExp();

        $this->assertTrue($regEx->test("234asd"));
        $this->assertFalse($regEx->test("asd425"));
    }

    public function testNotLetters()
    {
        $regEx = $this->r
            ->startOfLine()
            ->exactly(1)
            ->notLetters()
            ->getRegExp();

        $this->assertTrue($regEx->test("234asd"));
        $this->assertTrue($regEx->test("@234asd"));

        $this->assertFalse($regEx->test("asd425"));
    }

    public function testNotDigit()
    {
        $regEx = $this->r
            ->startOfLine()
            ->notDigit()
            ->getRegExp();

        $this->assertTrue($regEx->test("a234asd"));

        $this->assertFalse($regEx->test("45asd"));
    }

    public function testNotDigits()
    {
        $regEx = $this->r
            ->startOfLine()
            ->exactly(1)
            ->notDigits()
            ->getRegExp();

        $this->assertTrue($regEx->test("a234asd"));
        $this->assertTrue($regEx->test("@234asd"));

        $this->assertFalse($regEx->test("425asd"));
    }

    public function testAny()
    {
        $regEx = $this->r
            ->startOfLine()
            ->any()
            ->getRegExp();

        $this->assertTrue($regEx->test("a.jpg"));
        $this->assertTrue($regEx->test("a.b_asdasd"));
        $this->assertTrue($regEx->test("4"));

        $this->assertFalse($regEx->test(""));
    }

    public function testOfAny()
    {
        $regEx = $this->r
            ->startOfLine()
            ->exactly(2)
            ->ofAny()
            ->then("_")
            ->getRegExp();

        $this->assertTrue($regEx->test("12_123123.jpg"));
        $this->assertTrue($regEx->test("ab_asdasd"));

        $this->assertFalse($regEx->test("425asd"));
    }

    public function testOfAny2()
    {
        $regEx = $this->r
            ->startOfLine()
            ->exactly(3)->ofAny()
            ->endOfLine()
            ->getRegExp();

        $this->assertTrue($regEx->test("pqr"));
    }

    public function testAnything()
    {
        $regEx = $this->r
            ->startOfLine()
            ->anything()
            ->getRegExp();

        $this->assertTrue($regEx->test("a.jpg"));
        $this->assertTrue($regEx->test("a.b_asdasd"));
        $this->assertTrue($regEx->test("4"));
    }

    public function testAnythingBut()
    {
        $regEx = $this->r
            ->startOfInput()
            ->anythingBut("admin")
            ->getRegExp();

        $this->assertTrue($regEx->test("a.jpg"));
        $this->assertTrue($regEx->test("a.b_asdasd"));
        $this->assertTrue($regEx->test("4"));

        $this->assertFalse($regEx->test("admin"));

    }

    public function testAnythingBut2()
    {
        $regEx = $this->r
            ->startOfLine()
            ->anythingBut("Y")
            ->getRegExp();

        $this->assertTrue($regEx->test("a.jpg"));
        $this->assertTrue($regEx->test("a.b_asdasd"));
        $this->assertTrue($regEx->test("4"));

        $this->assertFalse($regEx->test("YY"));
        $this->assertFalse($regEx->test("Y"));

    }

    public function testLowerCasew()
    {
        $regEx = $this->r
            ->startOfLine()
            ->lowerCaseLetter()
            ->getRegExp();

        $this->assertTrue($regEx->test("a24"));
<commit_msg>test neither nor<commit_after><?php

namespace Gherkins\RegExpBuilderPHP\Test;


class RegExpBuilderTest extends \PHPUnit_Framework_TestCase
{

    /**
     * @var \Gherkins\RegExpBuilderPHP\RegExpBuilder
     */
    public $r;

    public function setUp()
    {
        $this->r = new \Gherkins\RegExpBuilderPHP\RegExpBuilder();
    }

    public function testRegExp()
    {
        $regEx = $this->r
            ->startOfLine()
            ->exactly(1)
            ->of("p")
            ->getRegExp();


        $this->assertTrue(is_string($regEx->getFlags()));
        $this->assertTrue($regEx->getFlags() === "m");

        $this->assertTrue(is_string($regEx->__toString()));
        $this->assertTrue(is_string($regEx->getExpression()));

    }

    public function testLettersDigits()
    {
        $regEx = $this->r
            ->startOfLine()
            ->min(3)
            ->letters()
            ->append($this->r->getNew()->min(2)->digits())
            ->getRegExp();

        $this->assertTrue($regEx->test("asf24"));

        $this->assertFalse($regEx->test("af24"));
        $this->assertFalse($regEx->test("afs4"));
        $this->assertFalse($regEx->test("234asas"));

    }

    public function testNotLetter()
    {
        $regEx = $this->r
            ->startOfLine()
            ->notLetter()
            ->getRegExp();

        $this->assertTrue($regEx->test("234asd"));
        $this->assertFalse($regEx->test("asd425"));
    }

    public function testNotLetters()
    {
        $regEx = $this->r
            ->startOfLine()
            ->exactly(1)
            ->notLetters()
            ->getRegExp();

        $this->assertTrue($regEx->test("234asd"));
        $this->assertTrue($regEx->test("@234asd"));

        $this->assertFalse($regEx->test("asd425"));
    }

    public function testNotDigit()
    {
        $regEx = $this->r
            ->startOfLine()
            ->notDigit()
            ->getRegExp();

        $this->assertTrue($regEx->test("a234asd"));

        $this->assertFalse($regEx->test("45asd"));
    }

    public function testNotDigits()
    {
        $regEx = $this->r
            ->startOfLine()
            ->exactly(1)
            ->notDigits()
            ->getRegExp();

        $this->assertTrue($regEx->test("a234asd"));
        $this->assertTrue($regEx->test("@234asd"));

        $this->assertFalse($regEx->test("425asd"));
    }

    public function testAny()
    {
        $regEx = $this->r
            ->startOfLine()
            ->any()
            ->getRegExp();

        $this->assertTrue($regEx->test("a.jpg"));
        $this->assertTrue($regEx->test("a.b_asdasd"));
        $this->assertTrue($regEx->test("4"));

        $this->assertFalse($regEx->test(""));
    }

    public function testOfAny()
    {
        $regEx = $this->r
            ->startOfLine()
            ->exactly(2)
            ->ofAny()
            ->then("_")
            ->getRegExp();

        $this->assertTrue($regEx->test("12_123123.jpg"));
        $this->assertTrue($regEx->test("ab_asdasd"));

        $this->assertFalse($regEx->test("425asd"));
    }

    public function testOfAny2()
    {
        $regEx = $this->r
            ->startOfLine()
            ->exactly(3)->ofAny()
            ->endOfLine()
            ->getRegExp();

        $this->assertTrue($regEx->test("pqr"));
    }

    public function testAnything()
    {
        $regEx = $this->r
            ->startOfLine()
            ->anything()
            ->getRegExp();

        $this->assertTrue($regEx->test("a.jpg"));
        $this->assertTrue($regEx->test("a.b_asdasd"));
        $this->assertTrue($regEx->test("4"));
    }

    public function testAnythingBut()
    {
        $regEx = $this->r
            ->startOfInput()
            ->anythingBut("admin")
            ->getRegExp();

        $this->assertTrue($regEx->test("a.jpg"));
        $this->assertTrue($regEx->test("a.b_asdasd"));
        $this->assertTrue($regEx->test("4"));

        $this->assertFalse($regEx->test("admin"));

    }

    public function testAnythingBut2()
    {
        $regEx = $this->r
            ->startOfLine()
            ->anythingBut("Y")
            ->getRegExp();

        $this->assertTrue($regEx->test("a.jpg"));
        $this->assertTrue($regEx->test("a.b_asdasd"));
        $this->assertTrue($regEx->test("4"));

        $this->assertFalse($regEx->test("YY"));
        $this->assertFalse($regEx->test("Y"));

    }

    public function testNeitherNor()
    {

        $regEx = $this->r
            ->startOfLine()
            ->neither($this->r->getNew()->exactly(1)->of("milk"))
            ->nor($this->r->getNew()->exactly(1)->of("juice"))
            ->getRegExp();

        $this->assertTrue($regEx->test("beer"));

        $this->assertFalse($regEx->test("milk"));
        $this->assertFalse($regEx->test("juice"));

    }

    public function testNeitherNor2()
    {

        $regEx = $this->r
            ->startOfLine()
            ->neither("milk")
            ->nor($this->r->getNew()->exactly(1)->of("juice"))
            ->getRegExp();

        $this->assertTrue($regEx->test("beer"));

        $this->assertFalse($regEx->test("milk"));
        $this->assertFalse($regEx->test("juice"));

    }

    public function testLowerCasew()
    {
        $regEx = $this->r
            ->startOfLine()
            ->lowerCaseLetter()
            ->getRegExp();

        $this->assertTrue($regEx->test("a24"));

{'fraction_non_alphanumeric': 0.19743385717127512, 'fraction_numerical': 0.012930177043962602, 'mean_word_length': 1.9153377790663961, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 325, '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': '5080979', 'n_tokens_mistral': 3250, 'n_tokens_neox': 3125, 'n_words': 364}