<commit_before><?php
namespace spec\watoki\scrut;

use watoki\scrut\Asserter;
use watoki\scrut\Failure;
use watoki\scrut\failures\IncompleteTestFailure;
use watoki\scrut\listeners\ArrayListener;
use watoki\scrut\tests\FailureSourceLocator;
use watoki\scrut\tests\generic\GenericTestCase;
use watoki\scrut\tests\generic\GenericTestSuite;
use watoki\scrut\tests\plain\PlainTestCase;
use watoki\scrut\tests\plain\PlainTestSuite;
use watoki\scrut\tests\statics\StaticTestCase;
use watoki\scrut\tests\statics\StaticTestSuite;

class FindLocationOfFailure extends StaticTestSuite {

    protected function getTests() {
        return [
            new FindLocationOfFailure_InGenericTestSuite(),
            new FindLocationOfFailure_InStaticTestSuite(),
            new FindLocationOfFailure_InPlainTestSuite(),
        ];
    }
}

class FindLocationOfFailure_TestSuite extends StaticTestSuite {

    /** @var ArrayListener */
    protected $listener;

    protected function before() {
        $this->listener = new ArrayListener();
    }

    protected function assertLocationIsAtLine($line) {
        /** @var \watoki\scrut\results\FailedTestResult $result */
        $result = $this->listener->results[0];
        $expected = FailureSourceLocator::formatFileAndLine(__FILE__, $line);
        $this->assert($result->getFailure()->getFailureSource(), $expected);
    }

}

class FindLocationOfFailure_InGenericTestSuite extends FindLocationOfFailure_TestSuite {

    /** @var GenericTestSuite */
    private $suite;

    /** @internal */
    protected function getOwnName() {
        return 'InGenericTestSuite';<commit_msg>Gave FindLocation test suites proper names<commit_after><?php
namespace spec\watoki\scrut;

use watoki\scrut\Asserter;
use watoki\scrut\Failure;
use watoki\scrut\failures\IncompleteTestFailure;
use watoki\scrut\listeners\ArrayListener;
use watoki\scrut\TestName;
use watoki\scrut\tests\FailureSourceLocator;
use watoki\scrut\tests\generic\GenericTestCase;
use watoki\scrut\tests\generic\GenericTestSuite;
use watoki\scrut\tests\plain\PlainTestCase;
use watoki\scrut\tests\plain\PlainTestSuite;
use watoki\scrut\tests\statics\StaticTestCase;
use watoki\scrut\tests\statics\StaticTestSuite;

class FindLocationOfFailure extends StaticTestSuite {

    protected function getTests() {
        return [
            new FindLocationOfFailure_InGenericTestSuite(),
            new FindLocationOfFailure_InStaticTestSuite(),
            new FindLocationOfFailure_InPlainTestSuite(),
        ];
    }
}

class FindLocationOfFailure_TestSuite extends StaticTestSuite {

    /** @var ArrayListener */
    protected $listener;

    protected function before() {
        $this->listener = new ArrayListener();
    }

    public function getName() {
        return (new TestName(FindLocationOfFailure::class))
            ->with(substr(get_class($this), strlen(FindLocationOfFailure::class) + 1, -9));
    }


    protected function assertLocationIsAtLine($line) {
        /** @var \watoki\scrut\results\FailedTestResult $result */
        $result = $this->listener->results[0];
        $expected = FailureSourceLocator::formatFileAndLine(__FILE__, $line);
        $this->assert($result->getFailure()->getFailureSource(), $expected);
    }

}

class FindLocationOfFailure_InGenericTestSuite extends FindLocationOfFailure_TestSuite {

    /** @var GenericTestSuite */
    private $suite;

    /** @internal */
    protected function getOwnName() {
        return 'InGenericTestSuite';
{'fraction_non_alphanumeric': 0.10515759312320917, 'fraction_numerical': 0.001146131805157593, 'mean_word_length': 4.023021582733813, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 16, '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': '5990674', 'n_tokens_mistral': 1015, 'n_tokens_neox': 990, 'n_words': 176}