<commit_before><?hh //partial

use typesafety\Result;
use stdClass;

describe('Result', function() {
    beforeEach(function() {
        $message = new stdClass();
        $message->code = 2055;
        $message->descr = "error message";
        $message->path = "/foo/var/example.hh";
        $message->line = 38;
        $message->end = 26;
        $message->start = 26;

        $errorObject = new stdClass();
        $errorObject->messages = [
            $message
        ];

        $resultObject = new stdClass();
        $resultObject->passed = true;
        $resultObject->version = "817b3a0 Nov 15 2014 13:25:51";
        $resultObject->errors = [
            $error
        ];

        $this->resultObject = $resultObject;
        $this->result = Result::fromObject($resultObject);
    });
    describe('#getVersion', function() {
        it('return version text', function() {
            expect($this->result->getVersion())->toBe("817b3a0 Nov 15 2014 13:25:51");
        });
    });
    describe('#isPassed', function() {
        context('when passed', function() {
            it('return true', function() {
                expect($this->result->isPassed())->toBeTrue();
            });
        });
    });
    describe('#getErrors', function() {
        it('return Iterator<Error> instance', function() {
            expect($this->result->getErrors())->toBeAnInstanceOf(Iterator::class);
        });
    });
});
<commit_msg>add spec<commit_after><?hh //partial

use typesafety\Result;
use stdClass;

describe('Result', function() {
    beforeEach(function() {
        $message = new stdClass();
        $message->code = 2055;
        $message->descr = "error message";
        $message->path = "/foo/var/example.hh";
        $message->line = 38;
        $message->end = 26;
        $message->start = 26;

        $errorObject = new stdClass();
        $errorObject->messages = [
            $message
        ];

        $resultObject = new stdClass();
        $resultObject->passed = true;
        $resultObject->version = "817b3a0 Nov 15 2014 13:25:51";
        $resultObject->errors = [
            $error
        ];

        $this->resultObject = $resultObject;
        $this->result = Result::fromObject($resultObject);
    });
    describe('#getVersion', function() {
        it('return version text', function() {
            expect($this->result->getVersion())->toBe("817b3a0 Nov 15 2014 13:25:51");
        });
    });
    describe('#isPassed', function() {
        context('when passed', function() {
            it('return true', function() {
                expect($this->result->isPassed())->toBeTrue();
            });
        });
        context('when failed', function() {
            beforeEach(function() {
                $this->resultObject->passed = false;
                $this->failedResult = Result::fromObject($this->resultObject);
            });
            it('return true', function() {
                expect($this->failedResult->isPassed())->toBeFalse();
            });
        });
    });
    describe('#getErrors', function() {
        it('return Iterator<Error> instance', function() {
            expect($this->result->getErrors())->toBeAnInstanceOf(Iterator::class);
        });
    });
});

{'fraction_non_alphanumeric': 0.17211597779148674, 'fraction_numerical': 0.027143738433066007, 'mean_word_length': 2.1272902603664416, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 54, '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': '5479899', 'n_tokens_mistral': 962, 'n_tokens_neox': 879, 'n_words': 161}