<commit_before>// Copyright 2016 <NAME>

package bot

import (
	"net"
	"testing"
)

func matchNickRe(s string, t *testing.T) {
	var m []string
	m = nickRe.FindStringSubmatch(s)
	if m == nil {
		t.Fail()
	}
	t.Log(m)
}

func TestNickRe(t *testing.T) {
	var s string

	s = "fe!~<EMAIL>"
	matchNickRe(s, t)

	s = "jayeshsolanki!~jayeshsol@192.168.3.11"
	matchNickRe(s, t)

	s = "j!~jayeshsol@192.168.3.11"
	matchNickRe(s, t)

	s = "de-facto_!~de-facto@unaffiliated/de-facto"
	matchNickRe(s, t)

	s = "c!~c@freenode"
	matchNickRe(s, t)
}

func newTestBot(ch chan bool) *Bot {
	config := &BotConfig{
		Trigger: '/',
		IRC: []*IRCConfig{
			&IRCConfig{
				Name:        "Localhost",
				Server:      "127.0.0.1",
				AutoConnect: false,
				Trigger:     '?',
				BotNick:     G,
			},
		},
	}
	bot := NewBot("TestBot", config)
	go func() {
		bot.Start()
		ch <- true
	}()
	for bot.State != Running {
	}
	return bot
}

func delTestBot(bot *Bot, t *testing.T, ch chan bool) {
	bot.Stop()<commit_msg>Set compile service for testing<commit_after>// Copyright 2016 <NAME>

package bot

import (
	"net"
	"testing"
)

func matchNickRe(s string, t *testing.T) {
	var m []string
	m = nickRe.FindStringSubmatch(s)
	if m == nil {
		t.Fail()
	}
	t.Log(m)
}

func TestNickRe(t *testing.T) {
	var s string

	s = "fe!~<EMAIL>"
	matchNickRe(s, t)

	s = "jayeshsolanki!~jayeshsol@192.168.3.11"
	matchNickRe(s, t)

	s = "j!~jayeshsol@192.168.3.11"
	matchNickRe(s, t)

	s = "de-facto_!~de-facto@unaffiliated/de-facto"
	matchNickRe(s, t)

	s = "c!~c@freenode"
	matchNickRe(s, t)
}

func newTestBot(ch chan bool) *Bot {
	config := &BotConfig{
		Trigger: '/',
		IRC: []*IRCConfig{
			&IRCConfig{
				Name:        "Localhost",
				Server:      "127.0.0.1",
				AutoConnect: false,
				Trigger:     '?',
				BotNick:     G,
			},
		},
		CompileServer: "127.0.0.1:1234",
	}
	bot := NewBot("TestBot", config)
	go func() {
		bot.Start()
		ch <- true
	}()
	for bot.State != Running {
	}
	return bot
}

func delTestBot(bot *Bot, t *testing.T, ch chan bool) {
	bot.Stop()
{'fraction_non_alphanumeric': 0.17886977886977887, 'fraction_numerical': 0.032432432432432434, 'mean_word_length': 3.072, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 7, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 7, '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': '4068723', 'n_tokens_mistral': 1044, 'n_tokens_neox': 912, 'n_words': 189}