MCPcopy Create free account
hub / github.com/codechenx/FastTableViewer / TestCountRuneFast

Function TestCountRuneFast

sepDector_test.go:138–160  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

136}
137
138func 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
162func TestGetCandidates(t *testing.T) {
163 sd := sepDetecor{}

Callers

nothing calls this directly

Calls 1

countRuneFastFunction · 0.85

Tested by

no test coverage detected