<commit_before><?php

class EngineTest extends PHPUnit_Framework_TestCase
{
    public function testSetup()
    {
        // Check if default config is applied
        $default = [
            'dictionary'    => __DIR__ . '/../../res/dictionary.json',
            'mods'          => __DIR__ . '/Mod/'
        ];
        \Ondine\Engine::setup();
        $config = \Ondine\Engine::getConfig();
        $this->assertEquals($config, $default);

        // Check if custom config is applied
        $default['dictionary'] = __DIR__ . '/dictionary.json';
        $default['mods'] = __DIR__ . '/';
        \Ondine\Engine::setup($default);
        $config = \Ondine\Engine::getConfig();
        $this->assertEquals($config, $default); //
    }<commit_msg>test - added some tests for Engine<commit_after><?php

class EngineTest extends PHPUnit_Framework_TestCase
{
    public function testSetup()
    {
        try
        {
            \Ondine\Engine::setup('test');
            $this->fail('Should crash');
        }
        catch (InvalidArgumentException $e) {}

        // Check if default config is applied
        $default = [
            'dictionary'    => __DIR__ . '/../../res/dictionary.json',
            'mods'          => __DIR__ . '/Mod/'
        ];
        \Ondine\Engine::setup();
        $config = \Ondine\Engine::getConfig();
        $this->assertEquals($config, $default);

        // Check if custom config is applied
        $default['dictionary'] = __DIR__ . '/dictionary.json';
        $default['mods'] = __DIR__ . '/';
        \Ondine\Engine::setup($default);
        $config = \Ondine\Engine::getConfig();
        $this->assertEquals($config, $default);
    }

    public function testAsk()
    {
        try {
            \Ondine\Engine::setup();
            $engine = \Ondine\Engine::getInstance();
            $engine->ask();

            $this->fail('Should crash');
        }
        catch(InvalidArgumentException $e) {}
    }
{'fraction_non_alphanumeric': 0.15700359158542843, 'fraction_numerical': 0.0, 'mean_word_length': 1.9235382308845577, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 14, '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': '5540107', 'n_tokens_mistral': 552, 'n_tokens_neox': 534, 'n_words': 108}