<commit_before>package lint

import "testing"

func TestRuleName_IsValid(t *testing.T) {
	tests := []struct {
		name  RuleName
		valid bool
	}{
		{"", false},
		{"a", true},
		{"::my_rule", false},
		{"my_namespace::", false},
		{"my_namespace:my_rule", false},
		{"my_namespace::my_rule", true},
		{"my_rule", true},
	}

	for _, test := range tests {
		if test.name.IsValid() != test.valid {
			t.Errorf("%q.IsValid()=%t; want %t", test.name, test.name.IsValid(), test.valid)
		}
	}
}

func TestNewRuleName(t *testing.T) {<commit_msg>added new test cases<commit_after>package lint

import "testing"

func TestRuleName_IsValid(t *testing.T) {
	tests := []struct {
		name  RuleName
		valid bool
	}{
		{"", false},
		{"a:::b", false},
		{"a::::b", false},
		{"a", true},
		{"::my_rule", false},
		{"my_namespace::", false},
		{"my_namespace:my_rule", false},
		{"my_namespace::my_rule", true},
		{"my_rule", true},
	}

	for _, test := range tests {
		if test.name.IsValid() != test.valid {
			t.Errorf("%q.IsValid()=%t; want %t", test.name, test.name.IsValid(), test.valid)
		}
	}
}

func TestNewRuleName(t *testing.T) {
{'fraction_non_alphanumeric': 0.21198568872987478, 'fraction_numerical': 0.0, 'mean_word_length': 4.180555555555555, 'pattern_counts': {'":': 2, '<': 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': '4701902', 'n_tokens_mistral': 464, 'n_tokens_neox': 434, 'n_words': 91}