<commit_before><?php

require_once dirname(__FILE__) . '/../../src/Utilities/String.php';

/**
 * Test class for IRCBot_Utilities_String.
 * Generated by PHPUnit on 2011-12-06 at 21:35:56.
 */
class IRCBot_Utilities_StringTest extends PHPUnit_Framework_TestCase {

    /**
     * @var IRCBot_Utilities_String
     */
    protected $object;

    /**
     * Sets up the fixture, for example, opens a network connection.
     * This method is called before a test is executed.
     */
    protected function setUp() {
        $this->object = new IRCBot_Utilities_String;
        $testString = 'Hello! This sentence should be tokenized.';
        IRCBot_Utilities_String::tokenize($testString);
    }

    /**
     * Tears down the fixture, for example, closes a network connection.
     * This method is called after a test is executed.
     */
    protected function tearDown() {
        
    }

    /**
     * @covers {className}::{origMethodName}
     * @todo Implement testTokenize().
     */
    public function testTokenize() {
        // Remove the following lines when you implement this test.
        $this->markTestIncomplete(
                'This test has not been implemented yet.'
        );
    }

    /**
     * @covers {className}::{origMethodName}
     */
    public function testToken() {
        $this->assertEquals('Hello!', IRCBot_Utilities_String::token('0'));
        $this->assertEquals('This sentence', IRCBot_Utilities_String::token('1-2'));
    }

    /**
     * @covers {className}::{origMethodName}
     */
    public function testTokenizeCleanup() {
        IRCBot_Utilities_String::tokenizeCleanup();
        $this->assertNotEquals('Hello!', IRCBot_Utilities_String::token('0'));
    }

    /**
     * @covers {className}::{origMethodName}
     */
    public function testRemoveNewlines() {
        $string = 'A string with ' . PHP_EOL . ' much ' . PHP_EOL . PHP_EOL
            . ' newlines';
        $newString = IRCBot_Utilities_String::removeNewlines($string);  
        $this->assertEquals('A string with much newlines', $newString);
    }

}

?><commit_msg>Updated the string utility unit tests<commit_after><?php

require_once dirname(__FILE__) . '/../../src/Utilities/String.php';

/**
 * Test class for IRCBot_Utilities_String.
 * Generated by PHPUnit on 2011-12-06 at 21:35:56.
 */
class IRCBot_Utilities_StringTest extends PHPUnit_Framework_TestCase {

    /**
     * @var IRCBot_Utilities_String
     */
    protected $object;

    /**
     * Sets up the fixture, for example, opens a network connection.
     * This method is called before a test is executed.
     */
    protected function setUp() {
        $this->object = new IRCBot_Utilities_String;
        $testString = 'Hello! This sentence should be tokenized.';
        IRCBot_Utilities_String::tokenize($testString);
    }

    /**
     * Tears down the fixture, for example, closes a network connection.
     * This method is called after a test is executed.
     */
    protected function tearDown() {
        
    }

    /**
     * @covers {className}::{origMethodName}
     */
    public function testTokenize() {
        $testString = 'Testing.Tokenize.Will.It.Work?';
        $tokens = IRCBot_Utilities_String::tokenize($testString, '.', true);
        $expected = array('Testing', 'Tokenize', 'Will', 'It', 'Work?');
        $this->assertEquals($expected, $tokens);
    }

    /**
     * @covers {className}::{origMethodName}
     */
    public function testToken() {
        $this->assertEquals('Hello!', IRCBot_Utilities_String::token('0'));
        $this->assertEquals('This sentence', IRCBot_Utilities_String::token('1-2'));
    }

    /**
     * @covers {className}::{origMethodName}
     */
    public function testTokenizeCleanup() {
        IRCBot_Utilities_String::tokenizeCleanup();
        $this->assertNotEquals('Hello!', IRCBot_Utilities_String::token('0'));
    }

    /**
     * @covers {className}::{origMethodName}
     */
    public function testRemoveNewlines() {
        $string = 'A string with ' . PHP_EOL . ' much ' . PHP_EOL . PHP_EOL
            . ' newlines';
        $newString = IRCBot_Utilities_String::removeNewlines($string);  
        $this->assertEquals('A string with much newlines', $newString);
    }

}

?>
{'fraction_non_alphanumeric': 0.13287864534336782, 'fraction_numerical': 0.008466603951081843, 'mean_word_length': 2.7339771729587357, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 17, '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': '5621244', 'n_tokens_mistral': 1268, 'n_tokens_neox': 1262, 'n_words': 284}