<commit_before>package server

import (
	"bytes"
	"fmt"
	"io/ioutil"
	"net/http"
	"net/http/httptest"
	"runtime"
	"strings"
	"sync"
	"testing"

	"github.com/klauspost/doproxy/server/httpmock"
)

type mockBackend struct {
	*backend
	n int
}

// ID returns a unique ID of this backend
func (d *mockBackend) ID() string {
	return fmt.Sprintf("id%d", d.n)
}

// ID returns a name of this backend
func (d *mockBackend) Name() string {
	return fmt.Sprintf("mockBackend%s", d.n)
}

var defaultConfig *Config
var loadOnce sync.Once

func newMockBackend(t *testing.T, n int) Backend {
	loadOnce.Do(func() {
		var err error
		defaultConfig, err = ReadConfigFile("testdata/validconfig.toml")
		if err != nil {
			t.Fatal("Unable to read config:", err)<commit_msg>Fix printf type<commit_after>package server

import (
	"bytes"
	"fmt"
	"io/ioutil"
	"net/http"
	"net/http/httptest"
	"runtime"
	"strings"
	"sync"
	"testing"

	"github.com/klauspost/doproxy/server/httpmock"
)

type mockBackend struct {
	*backend
	n int
}

// ID returns a unique ID of this backend
func (d *mockBackend) ID() string {
	return fmt.Sprintf("id%d", d.n)
}

// ID returns a name of this backend
func (d *mockBackend) Name() string {
	return fmt.Sprintf("mockBackend%d", d.n)
}

var defaultConfig *Config
var loadOnce sync.Once

func newMockBackend(t *testing.T, n int) Backend {
	loadOnce.Do(func() {
		var err error
		defaultConfig, err = ReadConfigFile("testdata/validconfig.toml")
		if err != nil {
			t.Fatal("Unable to read config:", err)
{'fraction_non_alphanumeric': 0.13545816733067728, 'fraction_numerical': 0.0, 'mean_word_length': 4.143344709897611, 'pattern_counts': {'":': 0, '<': 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': '2056938', 'n_tokens_mistral': 575, 'n_tokens_neox': 567, 'n_words': 155}