<commit_before>package chunker

import (
	"testing"

	"bytes"
	"io"
	"io/ioutil"
	"time"
)

func TestReadAll(t *testing.T) {
	n := 60
	l := 1
	buf := make([]byte, l*n)
	for i := 0; i < n; i++ {
		for j := 0; j < l; j++ {
			buf[l*i+j] = byte(i)
		}
	}

	t.Logf("Input bytes:  (%d) %x", len(buf), buf)

	emb := time.Now().Add(-10 * time.Millisecond)

	m := &mp3Chunker{
		chunks:     make([]chunk, n+2),
		start:      0,
		end:        n,
		errorState: io.EOF,
	}
	for i := 0; i < n; i++ {
		m.chunks[i].contents = buf[l*i : l*(i+1)]
		m.chunks[i].embargo = emb
	}

	chm := &chunkReader{
		parent:  m,
		current: n + 1,
	}

	s, err := ioutil.ReadAll(chm)
	if err != nil {
		t.Error(err)
	} else if !bytes.Equal(s, buf) {
		t.Logf("Result bytes: (%d) %x", len(s), s)
		t.Fail()
	}
}
<commit_msg>Update test to reflect new reality<commit_after>package chunker

import (
	"testing"

	"bytes"
	"io"
	"io/ioutil"
	"time"
)

func TestReadAll(t *testing.T) {
	n := 60
	l := 1
	buf := make([]byte, l*n)
	for i := 0; i < n; i++ {
		for j := 0; j < l; j++ {
			buf[l*i+j] = byte(i)
		}
	}

	t.Logf("Input bytes:  (%d) %x", len(buf), buf)

	emb := time.Now().Add(-10 * time.Millisecond)

	m := &chunkContainer{
		chunks:     make([]chunk, n+2),
		start:      0,
		end:        n,
		errorState: io.EOF,
	}
	for i := 0; i < n; i++ {
		m.chunks[i].contents = buf[l*i : l*(i+1)]
		m.chunks[i].embargo = emb
		m.chunks[i].seqno = uint32(i)
	}

	chm := &chunkReader{
		parent:  m,
		current: -1,
		seqno: 0xffffffff,
	}

	s, err := ioutil.ReadAll(chm)
	if err != nil {
		t.Error(err)
	} else if !bytes.Equal(s, buf) {
		t.Logf("Result bytes: (%d) %x", len(s), s)
		t.Fail()
	}
}

{'fraction_non_alphanumeric': 0.22001205545509342, 'fraction_numerical': 0.016877637130801686, 'mean_word_length': 2.672566371681416, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 1, 'word_list_counts': {'cursed_substrings.json': 1, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5379592', 'n_tokens_mistral': 853, 'n_tokens_neox': 789, 'n_words': 184}