<commit_before><?php

namespace regexp\Tests;

use Nette;
use	Tester;
use	Tester\Assert;

$container = require __DIR__ . '/bootstrap.php';

/**
 * Author <NAME> <<EMAIL>>
 *
 * @testCase
 */
class RegexpTest extends Tester\TestCase
{
	/** @var \regexp\Regexp */
	private $regexpServices;

	/** @var /Container */
	private $container;

	public function __construct($container)
	{
		$this->container = $container;
	}

	protected function setUp()
	{
		$this->regexpServices = $this->container->getService('regexp.regexp');
	}

	function testServiceConfiguration()
	{
		Assert::type('regexp\Regexp', $this->regexpServices);
	}

	function testMyRegular()
	{
		Assert::match($this->regexpServices->regulars['username'], '^[a-z0-9_-]{3,16}$');
	}

	function testEmbeddedRegular()
	{
		Assert::match($this->regexpServices->regulars['twitterUsername'], 'foo');
	}

	function testOverrideRegular()
	{
		Assert::match($this->regexpServices->regulars['hello'], 'foo');
	}
}

$test = new RegexpTest($container);
$test->run();<commit_msg>Added getter & setter test<commit_after><?php

namespace regexp\Tests;

use Nette;
use	Tester;
use	Tester\Assert;

$container = require __DIR__ . '/bootstrap.php';

/**
 * Author <NAME> <<EMAIL>>
 *
 * @testCase
 */
class RegexpTest extends Tester\TestCase
{
	/** @var \regexp\Regexp */
	private $regexpServices;

	/** @var /Container */
	private $container;

	public function __construct($container)
	{
		$this->container = $container;
	}

	protected function setUp()
	{
		$this->regexpServices = $this->container->getService('regexp.regexp');
	}

	function testServiceConfiguration()
	{
		Assert::type('regexp\Regexp', $this->regexpServices);
	}

	function testMyRegular()
	{
		Assert::match($this->regexpServices->regulars['username'], '^[a-z0-9_-]{3,16}$');
	}

	function testEmbeddedRegular()
	{
		Assert::match($this->regexpServices->regulars['twitterUsername'], 'foo');
	}

	function testOverrideRegular()
	{
		Assert::match($this->regexpServices->regulars['hello'], 'foo');
	}

	function testGetRegularExpression()
	{
		Assert::match($this->regexpServices->getRegularExpression('hello'), 'foo');
	}

	function testSetRegularExpression()
	{
		$this->regexpServices->setRegularExpression('hello2', 'bar');
		Assert::match($this->regexpServices->getRegularExpression('hello2'), 'bar');
	}
}

$test = new RegexpTest($container);
$test->run();
{'fraction_non_alphanumeric': 0.18143459915611815, 'fraction_numerical': 0.005063291139240506, 'mean_word_length': 5.322666666666667, 'pattern_counts': {'":': 0, '<': 11, '<?xml version=': 0, '>': 39, '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': '4124578', 'n_tokens_mistral': 841, 'n_tokens_neox': 794, 'n_words': 130}