<commit_before>package threadpool

import (
	"testing"
	"fmt"
	"time"
)

const (
	NumberOfWorkes = 20
	QueueSize = int64(1000)
)

var (
	Pool *ThreadPool
)

func TestNewThreadPool(t *testing.T) {
	Pool = NewThreadPool(NumberOfWorkes,QueueSize)
}

func TestThreadPool_Execute(t *testing.T) {
	data:= &Data{Val:"pristine"}
	task:=&TestTask{TestData:data}
	Pool.Execute(task)

	time.Sleep(2 * time.Second)
	fmt.Println("")

	if data.Val != "changed" {
		t.Fail()
	}
}

type TestTask struct {
	TestData *Data
}

type Data struct {
	Val string
}

func (t *TestTask) Run(){
	fmt.Println("Running the task")
	t.TestData.Val="changed"
}<commit_msg>refactoring<commit_after>package threadpool

import (
	"testing"
	"fmt"
	"time"
)

const (
	NumberOfWorkers = 20
	QueueSize       = int64(1000)
)

var (
	Pool *ThreadPool
)

func TestNewThreadPool(t *testing.T) {
	Pool = NewThreadPool(NumberOfWorkers,QueueSize)
}

func TestThreadPool_Execute(t *testing.T) {
	data:= &Data{Val:"pristine"}
	task:=&TestTask{TestData:data}
	Pool.Execute(task)

	time.Sleep(2 * time.Second)
	fmt.Println("")

	if data.Val != "changed" {
		t.Fail()
	}
}

type TestTask struct {
	TestData *Data
}

type Data struct {
	Val string
}

func (t *TestTask) Run(){
	fmt.Println("Running the task")
	t.TestData.Val="changed"
}
{'fraction_non_alphanumeric': 0.14774494556765164, 'fraction_numerical': 0.013996889580093312, 'mean_word_length': 4.523605150214593, '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': '3462261', 'n_tokens_mistral': 538, 'n_tokens_neox': 510, 'n_words': 102}