<commit_before>package fixchain

import "testing"

type fixErrorTest struct {
	ferr     FixError
	expected string
}

var fixErrorTests = []fixErrorTest{
	{
		ferr:     FixError{Type: None},
		expected: "None",
	},
	{
		ferr:     FixError{Type: ParseFailure},
		expected: "ParseFailure",
	},
	{
		ferr:     FixError{Type: CannotFetchURL},
		expected: "CannotFetchURL",
	},
	{
		ferr:     FixError{Type: FixFailed},
		expected: "FixFailed",
	},
	{
		ferr:     FixError{Type: LogPostFailed},
		expected: "LogPostFailed",
	},
	{
		ferr:     FixError{Type: VerifyFailed},
		expected: "VerifyFailed",
	},
	{
		ferr:     FixError{},
		expected: "None",
	},
}

func testTypeString(t *testing.T, f *fixErrorTest) {
	str := f.ferr.TypeString()
	if str != f.expected {
		t.Errorf("TypeString() returned incorrect string. "+
			"Expected %s, received %s.", f.expected, str)
	}
}

func TestTypeString(t *testing.T) {
	for _, test := range fixErrorTests {
		testTypeString(t, &test)
	}
}<commit_msg>Inline test function & alter test list format<commit_after>package fixchain

import "testing"

func TestTypeString(t *testing.T) {
	fixErrorTests := []struct {
		ferr     FixError
		expected string
	}{
		{
			FixError{Type: None},
			"None",
		},
		{
			FixError{Type: ParseFailure},
			"ParseFailure",
		},
		{
			FixError{Type: CannotFetchURL},
			"CannotFetchURL",
		},
		{
			FixError{Type: FixFailed},
			"FixFailed",
		},
		{
			FixError{Type: LogPostFailed},
			"LogPostFailed",
		},
		{
			FixError{Type: VerifyFailed},
			"VerifyFailed",
		},
		{
			FixError{},
			"None",
		},
	}

	for _, test := range fixErrorTests {
		if got, want := test.ferr.TypeString(), test.expected; got != want {
			t.Errorf("TypeString() returned %s, expected %s.", got, want)
		}
	}
}
{'fraction_non_alphanumeric': 0.15244596131968147, 'fraction_numerical': 0.0, 'mean_word_length': 3.464467005076142, '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': '5255581', 'n_tokens_mistral': 709, 'n_tokens_neox': 632, 'n_words': 134}