<commit_before>package sloth

import (
	"io/ioutil"
	"os"
	"testing"
	"time"
)

var (
	oldTime = time.Date(2016, time.February, 3, 15, 40, 0, 0, time.UTC)
	newTime = time.Date(2016, time.February, 3, 15, 45, 0, 0, time.UTC)

	currentTime = &oldTime
)

func init() {
	timeNow = func() time.Time {
		return *currentTime
	}
}

var logRotateTestCases = []struct {
	logger   *Logger
	filename string
}{
	{
		&Logger{Filename: "./test.log"}, "./test_20160203_1540.log",
	},
	{
		&Logger{Filename: "./test/test.log"}, "./test/test_20160203_1540.log",
	},
}

func TestRotate(t *testing.T) {<commit_msg>Refactor move test log rotate file to folder<commit_after>package sloth

import (
	"io/ioutil"
	"os"
	"testing"
	"time"
)

var (
	oldTime = time.Date(2016, time.February, 3, 15, 40, 0, 0, time.UTC)
	newTime = time.Date(2016, time.February, 3, 15, 45, 0, 0, time.UTC)

	currentTime = &oldTime
)

func init() {
	timeNow = func() time.Time {
		return *currentTime
	}
}

var logRotateTestCases = []struct {
	logger   *Logger
	filename string
}{
	{
		&Logger{Filename: "./TestRotate/test.log"}, "./TestRotate/test_20160203_1540.log",
	},
	{
		&Logger{Filename: "./TestRotate/InFolder/test.log"}, "./TestRotate/InFolder/test_20160203_1540.log",
	},
}

func TestRotate(t *testing.T) {
	makeTempDir("TestRotate")
	defer os.RemoveAll("TestRotate")
{'fraction_non_alphanumeric': 0.17192192192192193, 'fraction_numerical': 0.06906906906906907, 'mean_word_length': 4.049242424242424, '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': '1721137', 'n_tokens_mistral': 626, 'n_tokens_neox': 540, 'n_words': 112}