<commit_before><?php
namespace Tracing;

use Scheb\Tombstone\Tracing\PathNormalizer;

class PathNormalizerTest extends \PHPUnit_Framework_TestCase
{
    /**
     * @test
     * @dataProvider getBaseDirsToTest
     */
    public function makeRelativeTo_pathBeginsWithBase_returnRelativePath($baseDir) {
        $path = '/path/to/file.php';
        $returnValue = PathNormalizer::makeRelativeTo($path, $baseDir);
        $this->assertEquals('file.php', $returnValue);
    }

    public function getBaseDirsToTest()
    {
        return array(
            array('/path/to'),
            array('/path/to/'),
        );
    }

    /**
     * @test
     */
    public function makeRelativeTo_pathHasDifferentBase_returnSamePath() {
        $path = '/path/to/file.php';
        $baseDir = '/other/base';
        $returnValue = PathNormalizer::makeRelativeTo($path, $baseDir);
        $this->assertEquals('/path/to/file.php', $returnValue);
    }

    /**
     * @test
     */
    public function makeRelativeTo_noBaseDirGiven_returnSamePath() {
        $path = '/path/to/file.php';
        $returnValue = PathNormalizer::makeRelativeTo($path, null);
        $this->assertEquals('/path/to/file.php', $returnValue);
    }
}
<commit_msg>Added tests<commit_after><?php
namespace Tracing;

use Scheb\Tombstone\Tracing\PathNormalizer;

class PathNormalizerTest extends \PHPUnit_Framework_TestCase
{
    /**
     * @test
     */
    public function normalizeDirectorySeparator_unixPathGiven_returnSame()
    {
        $returnValue = PathNormalizer::normalizeDirectorySeparator('/path/to/some/file.php');
        $this->assertEquals('/path/to/some/file.php', $returnValue);
    }

    /**
     * @test
     */
    public function normalizeDirectorySeparator_windowsPathGiven_changeDirectorySeparator()
    {
        $returnValue = PathNormalizer::normalizeDirectorySeparator('C:\\path\\to\\some\\file.php');
        $this->assertEquals('C:/path/to/some/file.php', $returnValue);
    }

    /**
     * @test
     * @dataProvider getBaseDirsToTest
     */
    public function makeRelativeTo_pathBeginsWithBase_returnRelativePath($baseDir) {
        $path = '/path/to/file.php';
        $returnValue = PathNormalizer::makeRelativeTo($path, $baseDir);
        $this->assertEquals('file.php', $returnValue);
    }

    public function getBaseDirsToTest()
    {
        return array(
            array('/path/to'),
            array('/path/to/'),
        );
    }

    /**
     * @test
     */
    public function makeRelativeTo_pathHasDifferentBase_returnSamePath() {
        $path = '/path/to/file.php';
        $baseDir = '/other/base';
        $returnValue = PathNormalizer::makeRelativeTo($path, $baseDir);
        $this->assertEquals('/path/to/file.php', $returnValue);
    }

    /**
     * @test
     */
    public function makeRelativeTo_noBaseDirGiven_returnSamePath() {
        $path = '/path/to/file.php';
        $returnValue = PathNormalizer::makeRelativeTo($path, null);
        $this->assertEquals('/path/to/file.php', $returnValue);
    }
}

{'fraction_non_alphanumeric': 0.14224563714191638, 'fraction_numerical': 0.0, 'mean_word_length': 2.769230769230769, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 11, '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': '1671500', 'n_tokens_mistral': 922, 'n_tokens_neox': 911, 'n_words': 123}