(t *testing.T)
| 136 | } |
| 137 | |
| 138 | func TestCountRuneFast(t *testing.T) { |
| 139 | tests := []struct { |
| 140 | name string |
| 141 | s string |
| 142 | r rune |
| 143 | expected int |
| 144 | }{ |
| 145 | {"Count commas", "a,b,c,d", ',', 3}, |
| 146 | {"Count none", "abcd", ',', 0}, |
| 147 | {"Count all", ",,,,", ',', 4}, |
| 148 | {"Empty string", "", ',', 0}, |
| 149 | {"Single char", "a", 'a', 1}, |
| 150 | } |
| 151 | |
| 152 | for _, tt := range tests { |
| 153 | t.Run(tt.name, func(t *testing.T) { |
| 154 | result := countRuneFast(tt.s, tt.r) |
| 155 | if result != tt.expected { |
| 156 | t.Errorf("countRuneFast() = %d, want %d", result, tt.expected) |
| 157 | } |
| 158 | }) |
| 159 | } |
| 160 | } |
| 161 | |
| 162 | func TestGetCandidates(t *testing.T) { |
| 163 | sd := sepDetecor{} |
nothing calls this directly
no test coverage detected