<commit_before><?php

class RegexFilterTest extends PHPUnit_Framework_TestCase
{
    public function testFiltersUrlsThatDoNotMatchRegex()
    {
        $filter = new Mihaeu\Tarantula\Filter\RegexFilter('/^(https?:\/\/)?(www\.)?example\.com\/posts.*/');
        $this->assertFalse($filter->filter('http://test.com'));

        $this->assertTrue($filter->filter('https://example.com/posts/test.php'));
        $this->assertTrue($filter->filter('example.com/posts/1231'));
    }
}<commit_msg>Added more test cases.<commit_after><?php

class RegexFilterTest extends PHPUnit_Framework_TestCase
{
    public function testFiltersUrlsThatDoNotMatchRegex()
    {
        $filter = new Mihaeu\Tarantula\Filter\RegexFilter('/^(https?:\/\/)?(www\.)?example\.com\/posts.*/');
        $this->assertFalse($filter->filter('http://test.com'));

        $this->assertTrue($filter->filter('https://example.com/posts/test.php'));
        $this->assertTrue($filter->filter('example.com/posts/1231'));

        $filter = new Mihaeu\Tarantula\Filter\RegexFilter('/(part)|(\d+)/');
        $this->assertTrue($filter->filter('http://mike-on-a-bike.com/catching-up-part-3'));
        $this->assertTrue($filter->filter('http://mike-on-a-bike.com/100-days-on-the-road'));
    }
}
{'fraction_non_alphanumeric': 0.21023181454836132, 'fraction_numerical': 0.009592326139088728, 'mean_word_length': 3.7604562737642584, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 19, 'https://': 2, 'lorem ipsum': 0, 'www.': 2, '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': '4620556', 'n_tokens_mistral': 410, 'n_tokens_neox': 402, 'n_words': 36}