<commit_before><?php

namespace Zerg\Field;

use Zerg\Stream\StringStream;

class StringTest extends \PHPUnit_Framework_TestCase
{
    public function testRead()
    {
        $string = new String(2);
        $stream = new StringStream('abc');
        $this->assertEquals('ab', $string->read($stream));
    }

    public function testUtfRead()
    {
        $string = new String(4, ['utf' => 1]);
        $stream = new StringStream("\xff\xfeabc");
        $this->assertEquals('ab', $string->read($stream));
    }
}<commit_msg>Add empty utf string test<commit_after><?php

namespace Zerg\Field;

use Zerg\Stream\StringStream;

class StringTest extends \PHPUnit_Framework_TestCase
{
    public function testRead()
    {
        $string = new String(2);
        $stream = new StringStream('abc');
        $this->assertEquals('ab', $string->read($stream));
    }

    public function testUtfRead()
    {
        $string = new String(4, ['utf' => 1]);
        $stream = new StringStream("\xff\xfeabc");
        $this->assertEquals('ab', $string->read($stream));
    }

    public function testEmptyUtfString()
    {
        $string = new String(1, ['utf' => 1]);
        $stream = new StringStream("abc");
        $this->assertEquals('', $string->read($stream));
    }
}
{'fraction_non_alphanumeric': 0.16284584980237155, 'fraction_numerical': 0.006324110671936759, 'mean_word_length': 2.95625, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 16, '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': '6252075', 'n_tokens_mistral': 381, 'n_tokens_neox': 376, 'n_words': 83}