<commit_before>package coords

import (
	"testing"
)

func TestIndexOffset(t *testing.T) {
	oc1 := IndexOffset(0)
	expected1 := Offset{X: 0, Y: 0, Z: 0}
	if oc1 != expected1 {
		t.Error("Got ", oc1, " expected ", expected1)
	}

	oc2 := IndexOffset(32768 - 1)
	expected2 := Offset{
		X: ChunkWidth - 1,
		Y: ChunkHeight - 1,
		Z: ChunkDepth - 1,
	}
	if oc2 != expected2 {
		t.Error("Got ", oc2, " expected ", expected2)
	}

	for i := 0; i < BlocksPerChunk; i++ {
		oc := IndexOffset(i)
		i2 := oc.Index()
		if i != i2 {
			t.Error("Got ", i2, " expected ", i, " for offset ", oc)
		}
	}

	i := 0
	for oc := range EveryOffset() {<commit_msg>Don't hardcode constants.<commit_after>package coords

import (
	"testing"
)

func TestIndexOffset(t *testing.T) {
	oc1 := IndexOffset(0)
	expected1 := Offset{X: 0, Y: 0, Z: 0}
	if oc1 != expected1 {
		t.Error("Got ", oc1, " expected ", expected1)
	}

	oc2 := IndexOffset(BlocksPerChunk - 1)
	expected2 := Offset{
		X: ChunkWidth - 1,
		Y: ChunkHeight - 1,
		Z: ChunkDepth - 1,
	}
	if oc2 != expected2 {
		t.Error("Got ", oc2, " expected ", expected2)
	}

	for i := 0; i < BlocksPerChunk; i++ {
		oc := IndexOffset(i)
		i2 := oc.Index()
		if i != i2 {
			t.Error("Got ", i2, " expected ", i, " for offset ", oc)
		}
	}

	i := 0
	for oc := range EveryOffset() {
{'fraction_non_alphanumeric': 0.17705927636643573, 'fraction_numerical': 0.042340261739799843, 'mean_word_length': 3.0372670807453415, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 3, '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': '3275897', 'n_tokens_mistral': 590, 'n_tokens_neox': 529, 'n_words': 142}