<commit_before><?php
/******************************************************************************
 * An implementation of dicto (scg.unibe.ch/dicto) in and for PHP.
 * 
 * Copyright (c) 2016, 2015 <NAME> <<EMAIL>>
 *
 * This software is licensed under The MIT License. You should have received 
 * a copy of the license along with the code.
 */

use Lechimp\Dicto\App\Config;

class ConfigClassTest extends PHPUnit_Framework_TestCase {
    public function test_smoke() {
        $config = new Config(array(array
            ( "project" => array
                ( "root"    => "/root/dir"
                , "storage" => "/data"
                )
            , "analysis" => array
                ( "ignore" => array
                    ( ".*\\.omit_me"
                    )
                )
            )
        ));
        $this->assertEquals("/root/dir", $config->project_root());
        $this->assertEquals("/data", $config->project_storage());
        $this->assertEquals(array(".*\\.omit_me"), $config->analysis_ignore());
    }

    public function test_merge() {
        $config = new Config(array
            ( array
                ( "project" => array
                    ( "storage" => "/data"
                    )
                )
            , array
                ( "project" => array
                    ( "root" => "/root/dir"
                    )
                , "analysis" => array
                    ( "ignore" => array
                        ( ".*\\.omit_me"
                        )
                    )
                )
            )
        );
        $this->assertEquals("/root/dir", $config->project_root());
        $this->assertEquals("/data", $config->project_storage());
        $this->assertEquals(array(".*\\.omit_me"), $config->analysis_ignore());
    }

}<commit_msg>new style arrays<commit_after><?php
/******************************************************************************
 * An implementation of dicto (scg.unibe.ch/dicto) in and for PHP.
 * 
 * Copyright (c) 2016, 2015 <NAME> <<EMAIL>>
 *
 * This software is licensed under The MIT License. You should have received 
 * a copy of the license along with the code.
 */

use Lechimp\Dicto\App\Config;

class ConfigClassTest extends PHPUnit_Framework_TestCase {
    public function test_smoke() {
        $config = new Config([
            [ "project" =>
                [ "root"    => "/root/dir"
                , "storage" => "/data"
                ]
            , "analysis" =>
                [ "ignore" =>
                    [ ".*\\.omit_me"
                    ]
                ]
            ]]);
        $this->assertEquals("/root/dir", $config->project_root());
        $this->assertEquals("/data", $config->project_storage());
        $this->assertEquals([".*\\.omit_me"], $config->analysis_ignore());
    }

    public function test_merge() {
        $config = new Config(
            [
                [ "project" =>
                    [ "storage" => "/data"
                    ]
                ]
            , 
                [ "project" =>
                    [ "root" => "/root/dir"
                    ]
                , "analysis" =>
                    [ "ignore" =>
                        [ ".*\\.omit_me"
                        ]
                    ]
                ]
            ]);
        $this->assertEquals("/root/dir", $config->project_root());
        $this->assertEquals("/data", $config->project_storage());
        $this->assertEquals([".*\\.omit_me"], $config->analysis_ignore());
    }

}
{'fraction_non_alphanumeric': 0.19034171138096584, 'fraction_numerical': 0.0045184975995481505, 'mean_word_length': 1.3981042654028435, 'pattern_counts': {'":': 0, '<': 11, '<?xml version=': 0, '>': 55, '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': '2057499', 'n_tokens_mistral': 956, 'n_tokens_neox': 875, 'n_words': 179}