<commit_before>package goodman

import (
	"bufio"
	"net"
	"testing"
)

func TestSendingServerMessages(t *testing.T) {
	runner := DummyRunner{}
	server := NewServer([]Runner{&runner})

	go func() {
		err := server.Run()
		if err != nil {
			t.Fatalf("Dredd hooks server failed to start with error %s", err.Error())
		}
	}()

	messages := []struct {
		Payload []byte
	}{
		// TODO: Figure why I could not use `` quoted string
		{
			Payload: []byte("{\"uuid\":\"1234-abcd\",\"event\":\"beforeEach\",\"data\":{}}\n"),
		},
		{
			Payload: []byte("{\"uuid\":\"2234-abcd\",\"event\":\"beforeEachValidation\",\"data\":{}}\n"),
		},
		{
			Payload: []byte("{\"uuid\":\"2234-abcd\",\"event\":\"afterEach\",\"data\":{}}\n"),
		},
		{
			Payload: []byte("{\"uuid\":\"2234-abcd\",\"event\":\"beforeAll\",\"data\":[]}\n"),
		},
		{
			Payload: []byte("{\"uuid\":\"2234-abcd\",\"event\":\"afterAll\",\"data\":[]}\n"),<commit_msg>Remove TODO, literal new line would have been needed to use backticks<commit_after>package goodman

import (
	"bufio"
	"net"
	"testing"
)

func TestSendingServerMessages(t *testing.T) {
	runner := DummyRunner{}
	server := NewServer([]Runner{&runner})

	go func() {
		err := server.Run()
		if err != nil {
			t.Fatalf("Dredd hooks server failed to start with error %s", err.Error())
		}
	}()

	messages := []struct {
		Payload []byte
	}{
		{
			Payload: []byte("{\"uuid\":\"1234-abcd\",\"event\":\"beforeEach\",\"data\":{}}\n"),
		},
		{
			Payload: []byte("{\"uuid\":\"2234-abcd\",\"event\":\"beforeEachValidation\",\"data\":{}}\n"),
		},
		{
			Payload: []byte("{\"uuid\":\"2234-abcd\",\"event\":\"afterEach\",\"data\":{}}\n"),
		},
		{
			Payload: []byte("{\"uuid\":\"2234-abcd\",\"event\":\"beforeAll\",\"data\":[]}\n"),
		},
		{
			Payload: []byte("{\"uuid\":\"2234-abcd\",\"event\":\"afterAll\",\"data\":[]}\n"),
{'fraction_non_alphanumeric': 0.2989634478996181, 'fraction_numerical': 0.02182214948172395, 'mean_word_length': 3.57356608478803, 'pattern_counts': {'":': 30, '<': 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': '1249832', 'n_tokens_mistral': 750, 'n_tokens_neox': 674, 'n_words': 107}