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

Function TestUniqueChar

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

Source from the content-addressed store, hash-verified

217}
218
219func TestUniqueChar(t *testing.T) {
220 input := []rune{'a', 'b', 'a', 'c', 'b', 'd'}
221 result := uniqueChar(input)
222
223 // Check that result has no duplicates
224 seen := make(map[rune]bool)
225 for _, r := range result {
226 if seen[r] {
227 t.Errorf("Duplicate rune found: %c", r)
228 }
229 seen[r] = true
230 }
231
232 if len(result) > len(input) {
233 t.Error("Result should not have more elements than input")
234 }
235}
236
237func TestAllIntItemEqual(t *testing.T) {
238 tests := []struct {

Callers

nothing calls this directly

Calls 1

uniqueCharFunction · 0.85

Tested by

no test coverage detected