<commit_before>package imageserver

import (
	"fmt"
	"sync"
	"testing"
)

func TestNewCacheMissError(t *testing.T) {
	key := "foobar"
	cache := newCacheMap()
	previousErr := fmt.Errorf("not found")

	err := NewCacheMissError(key, cache, previousErr)
	err.Error()
}

type cacheMap struct {
	mutex sync.RWMutex
	data  map[string]*Image
}

func newCacheMap() *cacheMap {
	return &cacheMap{<commit_msg>Add test on NewParametersHashCacheKeyFunc<commit_after>package imageserver

import (
	"crypto/sha256"
	"fmt"
	"sync"
	"testing"
)

func TestNewCacheMissError(t *testing.T) {
	key := "foobar"
	cache := newCacheMap()
	previousErr := fmt.Errorf("not found")

	err := NewCacheMissError(key, cache, previousErr)
	err.Error()
}

func TestNewParametersHashCacheKeyFunc(t *testing.T) {
	f := NewParametersHashCacheKeyFunc(sha256.New)
	parameters := Parameters{
		"foo": "bar",
	}
	f(parameters)
}

type cacheMap struct {
	mutex sync.RWMutex
	data  map[string]*Image
}

func newCacheMap() *cacheMap {
	return &cacheMap{
{'fraction_non_alphanumeric': 0.13095238095238096, 'fraction_numerical': 0.005952380952380952, 'mean_word_length': 5.345911949685535, 'pattern_counts': {'":': 1, '<': 3, '<?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': '3654770', 'n_tokens_mistral': 373, 'n_tokens_neox': 365, 'n_words': 79}