<commit_before><?php
/**
 * Part of composer package: axelitus/base
 *
 * @package     axelitus\Base
 * @version     0.1
 * @author      <NAME> (<EMAIL>)
 * @license     MIT License
 * @copyright   2013 - Axel Pardemann
 * @link        http://axelitus.mx/projects/axelitus/base
 */

namespace axelitus\Base;

class TestsString extends TestCase
{
    public function test_length()
    {
        $this->assertEquals(33, String::length("This is a 33 chars length string."), "The length is not correctly calculated.");
        $this->assertEquals(83, String::length("This string, however, is a little bit longer, having in total a length of 83 chars."), "The length is not correctly calculated.");
    }
}<commit_msg>Added more tests for the String class.<commit_after><?php
/**
 * Part of composer package: axelitus/base
 *
 * @package     axelitus\Base
 * @version     0.1
 * @author      <NAME> (<EMAIL>)
 * @license     MIT License
 * @copyright   2013 - Axel Pardemann
 * @link        http://axelitus.mx/projects/axelitus/base
 */

namespace axelitus\Base;

class TestsString extends TestCase
{
    /**
     * Tests the String::is() function.
     */
    public function test_is_string()
    {
        $this->assertFalse(String::is(null), "The value null is incorrectly recognized as a string.");
        $this->assertTrue(String::is(""), "The value \"\" is not recognized as a string.");
        $this->assertTrue(String::is("Winter is coming!"), "The value \"Winter is coming!\" is not recognized as a string.");
        $this->assertTrue(String::is(new String("It is known.")), "The value [String:{ \$value: string(\"It is known.\") }] is not recognized as a string.");
        $this->assertFalse(String::is(56), "The value 56 is incorrectly recognized as a string.");
        $this->assertFalse(String::is(10.3), "The value 10.3 is incorrectly recognized as a string.");
    }

    /**
     * Tests the String::length() function.
     */
    public function test_length()
    {
        $this->assertEquals(33, String::length("This is a 33 chars length string."), "The length is not correctly calculated.");
        $this->assertEquals(83, String::length("This string, however, is a little bit longer, having in total a length of 83 chars."), "The length is not correctly calculated.");
    }

    // TODO: test the rest of the String functions
}
{'fraction_non_alphanumeric': 0.13957446808510637, 'fraction_numerical': 0.016170212765957447, 'mean_word_length': 3.161061946902655, 'pattern_counts': {'":': 0, '<': 9, '<?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': '2635616', 'n_tokens_mistral': 705, 'n_tokens_neox': 652, 'n_words': 231}